It would be great create models with a UUID as the pk by default.
It would be great to create models with a UUID as the pk by default. Ot at least have a checkbox for setting a primary key when creating a field.
Hi @adambirds ,
Thanks for the feedback, Yes I have often thought of adding as an explicit config when creating a model, but never got around to it. It would be a great time saver if you create a lot of models like that
I am assuming you are currently choosing UUID field from the Field Type dropdown and entering primary_key=True for the args? And then django will pick that up automatically as the primary key?
https://docs.djangoproject.com/en/4.2/topics/db/models/#automatic-primary-key-fields
But having this done automatically in the UI would be a useful feature?
Yes that's the way I was doing it, just manually adding the primary key to the field, but yeah would just make things quicker to have an option in the GUI!
Hey @adambirds I added an option for this on model creation. Was thinking it might be good to save a preference for this field, or use the last value used. Thoughts?
A preference seems the best way for me.