Best place for additional model constraints

2008-09-05 Thread TheShark
I am playing with a Django project which will deal with networking information. I would like to enforce some additional constraints above and beyond what the default Form fields provides. For example, if I have a model to represent a 'subnet' it would have both a network address (which I can save

Re: Best place for additional model constraints

2008-09-08 Thread TheShark
bruno desthuilliers wrote: > I'm afraid that if you want to use the admin app and still have a > robust (and correct) model, you'll have to apply solutions #2 *and* > #4. In order to restrict repetition to a minimum, you should factor > this validation rule in a function (possibly defined in th

Possible OneToOneField delete bug?

2008-09-10 Thread TheShark
I'm pretty new to Django, but I found some odd behavior in OneToOneField which I think is a bug. Take the following Models: class Widget(models.Model): name = models.CharField(max_length=10) def __unicode__(self): return u'%s(%s)'%(self.name,self.pk) class Sprocket(models.Model