Skip to content

Commit 146de4f

Browse files
committed
version 1.0.2
1 parent 755d278 commit 146de4f

File tree

5 files changed

+72
-24
lines changed

5 files changed

+72
-24
lines changed

MANIFEST.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
include LICENSE
2-
include README.rst
3-
recursive-include appointment *
4-
recursive-include appointment/templates *.html
5-
recursive-include appointment/static *.css *.js
2+
include README.md
3+
recursive-include appointment/migrations *.py
4+
recursive-include appointment/templates/appointment *.html
5+
recursive-include appointment/templates/base_templates *.html
6+
recursive-include appointment/static/css *.css
7+
recursive-include appointment/static/js *.js
8+
recursive-include appointment *.py
69
recursive-include docs *

README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Appointment Scheduler is a Django app designed for managing appointment scheduli
44
users to define custom configurations for time slots, lead time, and finish time, or use the default values provided.
55
The app also handles conflicts and availability for appointments, ensuring a smooth user experience.
66

7-
Detailed documentation is in the "docs" directory.
7+
Detailed documentation is in the ["docs"](docs/README.md) directory.
88

99
## Features
1010

@@ -19,7 +19,7 @@ Detailed documentation is in the "docs" directory.
1919

2020
```python
2121
INSTALLED_APPS = [
22-
'...',
22+
...
2323
'appointment',
2424
]
2525
```
@@ -30,36 +30,74 @@ INSTALLED_APPS = [
3030
from django.urls import path, include
3131

3232
urlpatterns = [
33-
'...',
33+
...
3434
path('appointment/', include('appointment.urls')),
3535
]
3636
```
3737

38-
3. Run `python manage.py migrate` to create the appointment models.
38+
3. In your Django's settings.py, add the following:
3939

40-
4. Start the development server and visit http://127.0.0.1:8000/admin/
40+
```python
41+
APPOINTMENT_CLIENT_MODEL = file.UserModel # Not optional (e.g. auth.User, or client.UserClient)
42+
```
43+
44+
for example if you use the default Django user model:
45+
46+
```python
47+
APPOINTMENT_CLIENT_MODEL = auth.User
48+
```
49+
50+
or if you use a custom user model:
51+
52+
```python
53+
APPOINTMENT_CLIENT_MODEL = client.UserClient
54+
```
55+
56+
Now if you have a custom user model, in your function create_user, you have to have the following arguments even if you
57+
don't use all of them:
58+
59+
```python
60+
def create_user(first_name, email, username, **extra_fields):
61+
pass
62+
```
63+
64+
This will create a user with the password = f"{APPOINTMENT_WEBSITE_NAME}{current_year}"
65+
66+
For example if you put in your settings.py:
67+
68+
```python
69+
APPOINTMENT_WEBSITE_NAME = 'Chocolates'
70+
```
71+
72+
and the current year is 2023, the password will be "Chocolates2023" if you don't provide an APPOINTMENT_WEBSITE_NAME,
73+
the default value is "Website", so the password will be "Website2023".
74+
75+
4. Run `python manage.py migrate` to create the appointment models.
76+
77+
78+
5. Start the development server and visit http://127.0.0.1:8000/admin/
4179
to create appointments, manage configurations, and handle appointment conflicts (you'll need the Admin app enabled).
4280

43-
5. You have to create at least a service before using the application in the admin page. If your service is free, add 0
81+
82+
6. You have to create at least a service before using the application in the admin page. If your service is free, add 0
4483
as the price. If you want to charge for your service, add the price in the price field. You can also add a
45-
description
46-
for your service.
84+
description for your service.
4785

48-
6. Visit http://127.0.0.1:8000/appointment/request/<service_id>/ to view the available time slots and schedule an
86+
7. Visit http://127.0.0.1:8000/appointment/request/<service_id>/ to view the available time slots and schedule an
4987
appointment.
5088

5189
## Customization
5290

5391
1. In your Django project's settings.py, you can override the default values for the appointment scheduler:
5492

5593
```python
94+
# Default values
5695
APPOINTMENT_SLOT_DURATION = 30 # minutes
5796
APPOINTMENT_LEAD_TIME = (9, 0) # (hour, minute) 24-hour format
5897
APPOINTMENT_FINISH_TIME = (16, 30) # (hour, minute) 24-hour format
5998

6099
# Additional configuration options
61-
APPOINTMENT_CLIENT_MODEL = 'auth.User'
62-
APPOINTMENT_BASE_TEMPLATE = 'base_templates/base.html'
100+
APPOINTMENT_BASE_TEMPLATE = 'base_templates/base.html' # your base template
63101
APPOINTMENT_WEBSITE_NAME = 'Website'
64102
APPOINTMENT_PAYMENT_URL = None
65103
APPOINTMENT_THANK_YOU_URL = None
@@ -73,3 +111,8 @@ APPOINTMENT_THANK_YOU_URL = None
73111

74112
For support or questions regarding the Appointment Scheduler app, please refer to the documentation in the "docs"
75113
directory or visit the GitHub repository for more information.
114+
115+
## Notes
116+
117+
The application doesn't send confirmation emails on appointment creation yet, but it will be implemented soon.
118+
Also the application doesn't send email reminders yet.

appointment/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from django.conf import settings
22

3-
APPOINTMENT_CLIENT_MODEL = getattr(settings, 'APPOINTMENTS_CLIENT_MODEL', 'auth.User')
3+
APPOINTMENT_CLIENT_MODEL = getattr(settings, 'APPOINTMENT_CLIENT_MODEL')
44
APPOINTMENT_BASE_TEMPLATE = getattr(settings, 'APPOINTMENT_BASE_TEMPLATE', 'base_templates/base.html')
5-
APPOINTMENT_WEBSITE_NAME = getattr(settings, 'WEBSITE_NAME', 'Website')
5+
APPOINTMENT_WEBSITE_NAME = getattr(settings, 'APPOINTMENT_WEBSITE_NAME', 'Website')
66
APPOINTMENT_PAYMENT_URL = getattr(settings, 'APPOINTMENT_PAYMENT_URL', None)
77
APPOINTMENT_THANK_YOU_URL = getattr(settings, 'APPOINTMENT_THANK_YOU_URL', None)
88
APPOINTMENT_SLOT_DURATION = getattr(settings, 'APPOINTMENT_SLOT_DURATION', 30)

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ the information about the appointment.
3131

3232
### Appointment
3333
The appointment model is used to define the last step in the appointment scheduling. It has the following fields:
34-
- client: The client that made the appointment, (default model : auth.User)
34+
- client: The client that made the appointment
3535
- appointment_request: The appointment request that the appointment is based on
3636
- phone: The phone number of the client
3737
- address: The address of the client

setup.cfg

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[metadata]
22
name = django-appointment
3-
version = 1.0.0
4-
description = "A Django app for managing appointment scheduling with ease and flexibility."
3+
version = 1.0.2
4+
description = A Django app for managing appointment scheduling with ease and flexibility.
55
url = https://github.com/adamspd/django-appointment
6-
author = "Adams Pierre David"
7-
author_email = "[email protected]"
8-
author_website = "https://adamspierredavid.com/"
6+
author = Adams Pierre David
7+
author_email = [email protected]
8+
author_website = https://adamspierredavid.com/
99
readme = README.md
1010
license = Apache License 2.0
1111
classifiers =
@@ -22,10 +22,12 @@ classifiers =
2222
Programming Language :: Python :: 3.11
2323
Topic :: Internet :: WWW/HTTP
2424
Topic :: Internet :: WWW/HTTP :: Dynamic Content
25+
Topic :: Software Development :: Libraries :: Application Frameworks
26+
Topic :: Software Development :: Libraries :: Django
2527

2628
[options]
2729
include_package_data = true
2830
packages = find:
29-
python_requires = >=3.10
31+
python_requires = >=3.8
3032
install_requires =
3133
Django >= 4.2

0 commit comments

Comments
 (0)