Коллеги, здравствуйте!
Подскажите, пожалуйста, у меня в модели есть поле
dCreated = models.DateTimeField(auto_now_add=True)
когда я делаю миграцию, Джанго от меня чегото хочет. Подскажите чего?
You are trying to add the field 'dCreated' with 'auto_now_add=True' to protokol without a default; the database needs something to populate existing rows.
1) Provide a one-off default now (will be set on all existing rows)
2) Quit, and let me add a default in
models.pySelect an option: 1
Please enter the default value now, as valid Python
You can accept the default '
timezone.now' by pressing 'Enter' or you can provide another value.
The datetime and django.utils.timezone modules are available, so you can do e.g.
timezone.nowType 'exit' to exit this prompt
[default:
timezone.now] >>>