Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda