[Fixed]-How to represent month as field on django model

22👍

I would recommend you continue using Django’s models.DateField, since this will allow your to retain calendar queries performed on time-based series and it might save you from a potential case of overengineering.

When displaying the model data, use the available datetime functions to display just the month of the year. When authoring the data, you can simply present users with a custom form widget and update the date to the 1st of the month when the form validates.

Leave a comment