Hallo Folks,
I hope you can help me with a little problem I came in touch with while building a model with a foreign key to itself.
Here an example:
class Example (model.Model):
parent = models.ForeignKey('self', null=True, blank=True)
# and some other fields
After creating a new entry in the admin panel and going into this example for editing some content, I realize that I could set the parent to the current entry. But thats not what I wanted to get with the ForeignKey and the relation to itself.
Is it possible to disallow the link to itself?
Maybe it's better to use a integer field with the right choices but I'm not quiet sure how to realize this an a smooth and Python like way.
Big thanks
Lemmi