Why does django give me an error:
TypeError: __init__() got an unexpected keyword argument 'input_formats' at
start_time=models.DateTimeField(input_formats='%d-%m-%y %H:%M')
Is there something wrong with the input format? what should i do if i want the format input to be date - month - year hour minute
?
You have confused model DateTimeFields and form DateTimeFields. Models don't take input_formats
arguments, forms do.
From Working with forms: the form library and API (which is what it sounds like you want) is to help you create HTML forms, do input validation, etc.
From Models and databases: A model is the single, definitive source of data about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single database table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With