if this is my models.py:
class Category(models.Model):
name = models.CharField(max_length=500)
slug = models.SlugField(unique=True)
def __unicode__(self):
return self.name
def get_absolute_url(self):
return "%s" % self.slug
class Item(models.Model):
name = models.CharField(max_length=500)
slug = models.SlugField(unique=True)
category = models.ManyToManyField(Category)
def __unicode__(self):
return self.name
def get_absolute_url(self):
return "%s" % self.slug
My desired functionality is to have any Category that has already had a an Item assigned to it to not be available for any other Items. For example, if I have these Categories: { Animal, Vegetable, Mineral }, and i assign the Item "Rock" to the Category "Mineral", when I add the next Item, "Mineral" will be unavailable from the list in admin. Hopefully that makes sense, and thank you for your time.