On Jan 15, 9:40 am, Michael Thon <mike.t...@gmail.com> wrote: > Here is the Post model, from the feedjack app > > class Post(models.Model): > feed = models.ForeignKey(Feed, verbose_name=_('feed'), null=False, > blank=False) > title = models.CharField(_('title'), max_length=255) > link = models.URLField(_('link'), ) > content = models.TextField(_('content'), blank=True) > date_modified = models.DateTimeField(_('date modified'), null=True, > blank=True) > guid = models.CharField(_('guid'), max_length=200, db_index=True) > author = models.CharField(_('author'), max_length=50, blank=True) > author_email = models.EmailField(_('author email'), blank=True) > comments = models.URLField(_('comments'), blank=True) > tags = models.ManyToManyField(Tag, verbose_name=_('tags')) > date_created = models.DateField(_('date created'), auto_now_add=True) > > Here is my SensePost model in my app: > > class SensePost (models.Model): > feedjackpost = models.OneToOneField(Post, blank=True, null=True) > raw_text = models.TextField(blank=True, null=True) > processed = models.BooleanField(default=False) > > For each calendar day, I need a list of SensePost objects. So, this is my > code: > > dates = Post.objects.dates('date_created', 'day') > for date in dates: > sensepost_list = SensePost.objects.filter(processed=True, > feedjackpost__date_created__exact=date) > > and that last line is where I get the FieldError exception. I can think of > other ways to do this - like making a list of Posts rather than SensePosts, > and I should still be able to access the SensePost properties. The way I > wrote it seems the most appropriate...but then it doesn't work... > > Thanks > Mike
Hmm, that should work. What happens if you drop the '__exact' from the end of the filter? It's the default anyway, so shouldn't make a difference to the result. -- DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.