I am using the admin to do all of my data input.

I have the following models:

class City(models.Model):
    city = models.CharField(max_length=100, unique=True)

class Place(models.Model):
    city = models.ForeignKey(City)
    title = models.CharField(max_length=255)
    is_featured = models.BooleanField(_('is featured'), default=False,
                                    help_text=_('Featured place will
be displayed in the places_by_city view.'))

Lets say using the models above I want to have only one place be
featured per city. So if I have the following data:

Cities
--------
San Diego
Los Angeles

Places
----------
Balboa Park
Sea World
Petco Park

What is the best practice for making it so when I toggle is_featured
to on for Balboa Park the admin enforces a rule that only one place
can be featured for a city. Hope that makes sense, thank you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to