foad-heidari / dj-booking Goto Github PK
View Code? Open in Web Editor NEWfree and complete booking package for Django
License: Other
free and complete booking package for Django
License: Other
change the app name to dj-booking or ...
change the name also from the readme
admin can remove or approve any appointment
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
admin can change some settings from seetings.py
booking_header
booking_description
background_img
success_redirect_url
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.
@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
don't gitignore static folder
add the option to admin setting
user get a URL on the email to edit/remove the booking
the link should be deactivated after the appointment finished
only superuser or stuff or settings.BOOKING_ADMIN_GROUP name should be able to see the booking admin page
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.
Add success or error redirect URL
Add to setting.py or booking admin
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 to the admin dashboard
user can change:
General
Date
time
Other
on dashboard -> appointments: sorting and pagination doesn't work
Remove bootstrap and font-awesome from the project and use custom CSS/SCSS and SVG for icons
check and see we can add any improvements changes
customers should get an email after approve/disapprove or changing the appointment
option to enable email notification in the admin setting
If I say I want to set every time an example at 8AM can book 10 users at a time. how can i archive that
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
hi, anya idea howto disable a rest time start 13.00pm -14.00pm ?
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
Not sure what's the plan with this field, but it's empty. Just remove? Or
I found a solution for this item, could be implement in the future:
In
views.py
modify the functionget_available_time()
adding like this:
Add this line in definition:
max_booking_per_time = booking_settings.max_booking_per_time
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 😄
check all models and functions before first release and refactor the project
make use of the settings which admin defind.
check if we need to use a Django package manager or not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.