Could you please give me a real example when should I use auto_created attribute in definitions of django model fields? https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.Field.auto_created ? Which kind of problems could be solved by using this flag?
Found one example here. http://www.programcreek.com/python/example/74720/django.db.migrations.CreateModel
Here is my wild guess: it is designed for Django primary key implementation, that is, you'd better do not use it unless you are developing Django itself.
fields=[
('pony_ptr', models.OneToOneField(
auto_created=True,
primary_key=True,
to_field='id',
serialize=False,
to='Pony',
)),
"cuteness", models.IntegerField(default=1)),
]
You aren't supposed to use it (at least to create fields with such attribute). auto_created=True means that field is created implicitly (id
field which is automatically created for your model if you don't specify different primary key).
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