Hi, I am relatively new to Django and I have a small problem making a query over the following Models ...
class GeographicTemporalCoverage(models.Model): beginning_temporal_coverage_date = models.DateField() ending_temporal_coverage_date = models.DateField() .... class Coverage(models.Model): geo_temp_coverage = models.ManyToManyField(GeographicTemporalCoverage) abstract = models.TextField() ... class DataSet(models.Model): ... dataset_id_nr = models.CharField(max_length=64) coverage = models.ForeignKey(Coverage) ... Now I want to query all DataSets having a coverage with a maximal ending_temporal_coverage of 2008 for example ... Can I do it in one query (how) or do I need to make two for that? I've tried something like ds = DataSet.objects.select_related().filter(coverage__geo_temp_coverage__ending_temporal_coverage_date<max_year).order_by('dataset_id_nr') but unfortunately it does not work ;). ( global name 'coverage__geo_temp_coverage__ending_temporal_coverage_date' is not defined) I also did not any hints in the documentation ... Thanks in advance! Katja -- Computer and Database Manager 3193 Energy, Coast & Environment Bldg. Louisiana State University Baton Rouge, LA, 70803 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---