Greetings Django Experts!
Say for example i have the following on my models.py
class Country(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return u'%s %s' % (
self.name, self.ID)
class Meta:
verbose_name = 'Countries'
class Users(models.Model):
name = models.CharField(max_length=50)
cUsers = models.ForeignKey(Country)
def __unicode__(self):
return
self.name
class Meta:
verbose_name = 'Users on a country'
class GoalsinCountry(models.Model):
gCountry = models.ForeignKey(Country)
name = models.CharField(max_length=50)
descr = models.TextField(blank=True, null=True)
def __unicode__(self):
return
self.name
class Meta:
verbose_name = 'Goals Topic'
How would you configure this in GoalsinCountry to return only users in
a particular country and save this to
GoalsinCountry Table?
if i use gCountry = models.ForeignKey(Users)
I would get a list of all users, i am interested in fitering to users
on a particular country??
Please advice
Thank you