Hello Folks,
I hope you can help me with a little problem when I Here is an example:
Here is an example:
class example (model.Model): parent = model. Araginki ('self', empty = true, empty = True) # and some other fields
After going into this example to create a new entry in the admin panel and edit some content, I know that I Can set up security have for the current entry, but it's not that I wanted to do in terms of foreign and own.
Is it possible to reject this link yourself? Maybe it is better to use an integer field with the right option, but I'm not sure how to feel like a smooth and python way like it is not silent.
Big thanks
Lemmi
One way to do this is to model Clean method must be overridden class example (model model): # ... def clean (self): if self.pid.id == self.id: increase validation error (" No Self Referenced Models ")
It will be called as the second step of the object verification and by putting the object in the database.
Comments
Post a Comment