L
L
lunrox2014-02-11 15:11:21
Django
lunrox, 2014-02-11 15:11:21

How to implement a work schedule in Django?

Good afternoon.
It is required to make a fillable work schedule.
On each day of the week, the user chooses from what to what time he works.
Please tell me how to implement the time selection from the list with an accuracy of half an hour.
So far, only the thought of making Choices with a lot of elements came to my mind, but I would like something more elegant.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nark Ebavich, 2014-02-11
@lunrox

Use a ready-made JS solution. Here is one of the first found:
arshaw.com/fullcalendar (Switch to Day from the top right)
If you need full integration into Django, do it by analogy with djbook.ru/examples/12

P
patient, 2014-02-14
@patient

In a TextField I store an object of the type serialized in JSON:

[{"start":"09:00","end":"14:00","lunch_start":"","lunch_end":""},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"18:00","lunch_start":"13:00","lunch_end":"14:00"},
{"start":"09:00","end":"14:00","lunch_start":"","lunch_end":""},
{"start":"","end":"","lunch_start":"","lunch_end":""}]

The templatetag is rendered into a form:
On the client side, all tracking is calculated by javascript. I didn't find an easier solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question