W dniu środa, 3 lipca 2019 03:34:30 UTC+2 użytkownik P O napisał:
>
> Hello,
> sorry if I am wrong, but I use somethig like:
> id=models.IntegerField(db_name="some_id", primary_key=True)
> and Django uses auto-key when I add objects this way:
> obj = Obj()
> obj.some_id= 1
> obj.save()
> obj = Obj()
> obj.some_id= 3
> obj.save()
> In default DB this objects have some_id=1 and some_id=2, There us no 
> errors, no warnings.
>
> Is it a bug? Without db_name works well. 
>


In python code use `id` not `some_id`. `some_id` is only used by django 
internally when talking to db server.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ac9aaeff-a6ad-4d01-ab18-0b0525cf345c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to