Giter Club home page Giter Club logo

dj-booking's People

Contributors

ezspot avatar foad-heidari avatar foadheidari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dj-booking's Issues

change the app name

change the app name to dj-booking or ...

change the name also from the readme

Needing VPN

Dear Foad,

I am really sorry that I am messaging here, but I couldn't find your contact.
Since you had a conversation on github about VPN, I am messaging.
I wanted to know if you have any free available VPN that I can use on my android mobile? I know there are ways to buy one, but due to the deficit of financial resources, I was wondering if you may have one that you can provide me.
I am only one user, and I want to use it for personal daily usages like instagram and telegram surfing.

If you have any, I would appreciate if you could provide me one.
My contact on telegram: ++989126936983
my email: [email protected]

Thank you for reading my message,
Amin

changeable text/images

admin can change some settings from seetings.py

  • title of the appointment page
  • description of the page
  • success URL
  • background image

Enhancement - Add Edit to appointment

Possible for admin to edit an appointment. When edit is done email is sendt out for new confirmation. Maybe even a "reason note" for changed date.

Infinite loop on the get_available_time function

@foad-heidari Hello, if I try to edit the period_of_each_booking field on the BookingSettings model to I hour through the admin and try to access the time in the template when I ran the app, it does not render and instead goes to an infinite loop. I investigated the issue and found out it is coming from the get_available_time function on the if next_time > booking_settings.end_time: break section. for some reason, the time_list doesn't break because next_time is not greater than booking_settings.end_time. please check it and let me know if it's also occurring on your side and anyone else reading this.

The infinite loop only occurs when I set the period_of_each_booking field on the BookingSettings to 1 hour or to 2 hours or to 3 hours in the admin

def add_delta(time: datetime.time, delta: datetime.datetime) -> datetime.time:
 # transform to a full datetime first
return (datetime.datetime.combine(
        datetime.date.today(), time
    ) + delta).time() 

def get_available_time(date: datetime.date) -> List[Dict[datetime.time, bool]]:
    """
    Check for all available time for selected date
    The times should ne betwwen start_time and end_time
    If the time already is taken -> is_taken = True
    """
    booking_settings = BookingSettings.objects.first()
    existing_bookings = Booking.objects.filter(
        date=date).values_list('time')
    max_booking_per_time = booking_settings.max_booking_per_time

    next_time = booking_settings.start_time
    time_list = []
    while True:
        is_taken = False  # Add this line
        if existing_bookings.count() == max_booking_per_time:  # Add this if
            is_taken = any([x[0] == next_time for x in existing_bookings])
        time_list.append(
            {"time": ":".join(str(next_time).split(":")[:-1]),
             "is_taken": is_taken})
        next_time = add_delta(next_time, datetime.timedelta(
            minutes=int(booking_settings.period_of_each_booking)))
        if next_time > booking_settings.end_time:
            break

    return time_list


Enhancement - Spesific days

Instead of everyday is available, set a var with the days that's possible to book.

Example:
Days_active = Monday, Wednesday, Friday

This means; Tuesday, Thursday, Saturday and Sunday is not possible.

Enhancement - Resourse management

When booking you can book a user that has a spesific 'tag' like "Worker", and this worker have time slots.
You could use the built in Django Users\Groups. \admin\

The worker needs to complete the 'Booking' and add a note.

Add settings Page

add Settings page to the admin dashboard

user can change:

  • General

    • Enable Booking : Default true
    • Booking type : Default Day and time
    • required Confirmation? : Default Yes
    • Login Required: Default False
  • Date

    • dissable weekend : Default True
    • start work day : Default Moday
    • max next bokking month : default 1
    • Max Appointment per Day : can be None
  • time

    • Sart Time : Default 09:00
    • End Time : Default 17:00
    • period of each appointment : Default 30 min
    • max appointmnet per eacth time : Default 1
  • Other

    • Name
    • Email
    • Address
    • Phone number
    • description

Bug and Enhancement

Possible to add 24 hours format? In admin settings.

It's possible to book an appointment after 'set time' the same day.
Like this: It's now 3.50 PM (15.50) But i can still pick that time and time before.
image

Enable email notification

  • customers should get an email after approve/disapprove or changing the appointment

  • option to enable email notification in the admin setting

Issue with backports.zoneinfo on python3.10

Hi,

I'm getting an error message when I try to install into the env on my VPS setup (see below).

I read that you don't need backports.zoneinfo from python3.9, which might be why it's not completing the install.

I also read that it's recommended to change the requirements.txt for backports to the below, to avoid this issue with later versions of Python:
backports.zoneinfo==0.2.1;python_version<"3.9"

I'm by no means an expert, I just try to suggest a possible solution when I run into a problem!

Thanks very much

$:~/httpdocs/Hares$ pip install dj-booking
Collecting dj-booking
Downloading dj-booking-1.6.2.tar.gz (287 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 287.9/287.9 KB 8.4 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Requirement already satisfied: Django>=4. in /var/www/vhosts/priceless-pascal.194-164-28-128.plesk .page/httpdocs/venv/lib/python3.10/site-packages (from dj-booking) (5.0.4)
Requirement already satisfied: asgiref>=3 in /var/www/vhosts/priceless-pascal.194-164-28-128.plesk .page/httpdocs/venv/lib/python3.10/site-packages (from dj-booking) (3.8.1)
Collecting backports.zoneinfo>=0.2
Downloading backports.zoneinfo-0.2.1.tar.gz (74 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.1/74.1 KB 32.3 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting django-formtools>=2
Downloading django_formtools-2.5.1-py3-none-any.whl (170 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 170.7/170.7 KB 44.7 MB/s eta 0:00:00
Collecting pycodestyle>=2
Downloading pycodestyle-2.11.1-py2.py3-none-any.whl (31 kB)
Requirement already satisfied: sqlparse>=0.4 in /var/www/vhosts/priceless-pascal.194-164-28-128.pl esk.page/httpdocs/venv/lib/python3.10/site-packages (from dj-booking) (0.5.0)
Collecting toml>=0.10
Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: typing-extensions>=4 in /var/www/vhosts/priceless-pascal.194-164-28 -128.plesk.page/httpdocs/venv/lib/python3.10/site-packages (from asgiref>=3->dj-booking) (4.11.0)
Using legacy 'setup.py install' for dj-booking, since package 'wheel' is not installed.
Building wheels for collected packages: backports.zoneinfo
Building wheel for backports.zoneinfo (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/backports
copying src/backports/init.py -> build/lib.linux-x86_64-cpython-310/backports
creating build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_version.py -> build/lib.linux-x86_64-cpython-310/backports/z oneinfo
copying src/backports/zoneinfo/_common.py -> build/lib.linux-x86_64-cpython-310/backports/zo neinfo
copying src/backports/zoneinfo/_tzpath.py -> build/lib.linux-x86_64-cpython-310/backports/zo neinfo
copying src/backports/zoneinfo/init.py -> build/lib.linux-x86_64-cpython-310/backports/z oneinfo
copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.linux-x86_64-cpython-310/backports/ zoneinfo
running egg_info
writing src/backports.zoneinfo.egg-info/PKG-INFO
writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
writing requirements to src/backports.zoneinfo.egg-info/requires.txt
writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.png' under directory 'docs'
warning: no files found matching '
.svg' under directory 'docs'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_output'
adding license file 'LICENSE'
adding license file 'licenses/LICENSE_APACHE'
writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
copying src/backports/zoneinfo/init.pyi -> build/lib.linux-x86_64-cpython-310/backports/ zoneinfo
copying src/backports/zoneinfo/py.typed -> build/lib.linux-x86_64-cpython-310/backports/zone info
running build_ext
building 'backports.zoneinfo._czoneinfo' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/lib
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fst ack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/var/www/vhosts/price less-pascal.194-164-28-128.plesk.page/httpdocs/venv/include -I/usr/include/python3.10 -c lib/zonei nfo_module.c -o build/temp.linux-x86_64-cpython-310/lib/zoneinfo_module.o -std=c99
error: command 'x86_64-linux-gnu-gcc' failed: No such file or directory
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for backports.zoneinfo
Failed to build backports.zoneinfo
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml- based projects

only select available date/time

check which time/dates are available to the user to select

base on admin settings/ each day and time should have 1 or .. appointment available

Bug - User_id

Not sure what's the plan with this field, but it's empty. Just remove? Or

Solution for Max Booking for Time

I found a solution for this item, could be implement in the future:

In views.py modify the function get_available_time() adding like this:

  1. Add this line in definition:
    max_booking_per_time = booking_settings.max_booking_per_time

  2. Set While like this:

while True:
    is_taken = False # Add this line
    if (existing_bookings.count() == max_booking_per_time): # Add this if
        is_taken = any([x[0] == next_time for x in existing_bookings])
    time_list.append(
        {"time": ":".join(str(next_time).split(":")[:-1]), "is_taken": is_taken})
    next_time = add_delta(next_time, datetime.timedelta(
        minutes=int(booking_settings.period_of_each_booking)))
    if next_time > booking_settings.end_time:
        break

Enjoy 😄

refactore

check all models and functions before first release and refactor the project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.