Re: search across models

2013-02-02 Thread Karen Tracey
You also posted this to django-users, which is where it belongs. Please do
not crosspost usage questions to django-developers; the topic of this list
is the development of Django itself.

Thanks,
Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




search across models

2013-02-02 Thread Aswani Kumar
hi all, i have a big question. 
how can i perform search queries like on following models

RESTAURANT_TYPES = (
('C', 'Chinese'),
('A', 'American'),
('J', 'Japanese'),
)

class city (models.Model):
name = models.CharField(max_length=200)

class restaurants(models.Model):
name = models.CharField(max_length=456)
city = models.ForeignKey(city)
type = models.CharField(max_length=10, choices=RESTAURANT_TYPES)
is_veg = models.BooleanField(default=True)

search queries:

   1. restaurants in city1
   2. city1 restaurants
   3. Chinese restaurants
   4. Chinese restaurants in city1
   5. vegetarian restaurants in city1
   6. vegetarian american restaurants
   7. and so on...

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.