What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-10 18:44:10
related name django
The related_name attribute specifies the name of the reverse relation from the User model back to your model. If you don't specify a related_name, Django automatically creates one using the name of your model with the suffix _set, for instance User.map_s... Add solution -
Python 2021-10-23 05:29:08
on_delete options django
There are seven possible actions to take when such event occurs: CASCADE: When the referenced object is deleted, also delete the objects that have references to it (when you remove a blog post for instance, you might want to delete comments as well). ... Add solution -
Other 2021-10-21 15:23:08
django two foreignkeys to same model admin error
class UserProfileInline(admin.StackedInline): model = Profile fk_name = "user" class SupervisorProfileInline(admin.StackedInline): model = Profile fk_name = "supervisor" class NewUserAdmin(NamedUserAdmin): inlines... Add solution -
Python 2021-10-20 07:30:06
on_delete=models.cascade
There are seven possible actions to take when such event occurs: CASCADE: When the referenced object is deleted, also delete the objects that have references to it (when you remove a blog post for instance, you might want to delete comments as well). ... Add solution