Fixed this problem. That's the second time I've searched for 1 hour+, wrote an email, and then quickly figured out a solution. I wonder if writing the email helps...
Anyway, the problem seemed to be that I was overriding the __getitem__ method to make my model instances work more like a sequence. However since the template "." tries a dictionary lookup first, "created" or "creator", etc were getting passed into getitem. So to make a long story short, it seems we cannot override the __getitem__ method on models due to the implicit behavior of "." in templates. I knew that implicit behavior would upset me someday :P I guess thats why we usually prefer explicit over implicit. - Steve On 11/27/06, Steve Wedig <[EMAIL PROTECTED]> wrote: > Hello, > > I am using multiple inheritance on a model. I'm just subclassing Model > and subclassing a class that acts like a mixin. The mixin only adds or > overrides methods. > > Anyway, this works fine with the python api, but is causing problems > inside a template. When inside a template, I get an error if I try to > access any of an instance's attributes... > > trying to access a creator ForeignKey to user... > Exception Type: ProgrammingError > Exception Value: ERROR: column "creator" does not exist SELECT > "thread_post"."id","thread_post"."created","thread_post"."creator_id","thread_post"."body","thread_post"."title","thread_post"."thread_id","thread_post"^ > Exception Location: > C:\Python25\lib\site-packages\django\db\backends\util.py in execute, > line 15 > > trying to access the creation time, which is a datetime... > Exception Type: ProgrammingError > Exception Value: ERROR: argument of OFFSET must be type integer, not > type timestamp with time zone SELECT > "thread_post"."id","thread_post"."created","thread_post"."creator_id","thread_post"."body","thread_post"."tit= > Exception Location: > C:\Python25\lib\site-packages\django\db\backends\util.py in execute, > line 15 > > Anyway, this all works fine in the python shell. It also works in the > template if I remove the mixin class. Does anyone have any idea what > may be causing this? > > Thanks, > Steve > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---