Issue #186 invalid

TypeError w/ Nested Fields

Anonymous created an issue

I have a model called Event that is like this:

{{{

!python

class Event(models.Model): leader = models.ForeignKey(User,) place = models.CharField(max_length=200) start_date = models.DateTimeField('date event starts') created_date = models.DateTimeField('date created') activity = models.CharField(max_length=100) }}}

My Handler works fine when I get all the fields, like so:

{{{

!python

fields = ( 'place', 'start_date', 'activity', 'leader' ) }}}

But fails when I try to pull out just one nested field like so:

{{{

!python

fields = ( 'place', 'start_date', 'activity', ('leader', ('username') ) ) }}}

With this:

TypeError at /events/1/ expected string or buffer

Any idea what I might be doing wrong?

Comments (2)

  1. Anonymous

    Apparently the problem stems from the exclude statement I have: exclude = ('id', re.compile(r'^private_'))

    Removing that has fixed the problem, sorry for the spam.

  2. Log in to comment