Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
Saving a Date in a Coisefield - Django?

so what I'm trying to build is basically a calendar. For this, a user has to choose a beginning date and time for an event as well as an end time. Everything then has to be stored - of course - in the database.

I want to realize that by using a ChoiseField (unless there is a better solution). How would it be possible to generate all the dates of the month in a coisefield since some months are 30 days others have a different length etc.? Same with the hours of a day?

I cant seem to come up with a working approach? How would one approach this problem? suggestions?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I would do it as two fields:

#models.py
class Event(models.Model):     
         start = models.DateTimeField(default=datetime.now())
         end = models.DateTimeField()

and for calendar (=widget) i would use this or some similar plugin: https://github.com/nkunihiko/django-bootstrap3-datetimepicker

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!