RE: template speed

2007-09-22 Thread Michael Elsdoerfer
> {% ifequal newsitem.user.id 12 %} Just a guess, but is it possible that this requires a separate query for the user for each item in object_list? Michael > -Original Message- > From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] > On Behalf Of [EMAIL PROTECTED] > Sent:

reverse select_related()

2007-09-13 Thread Michael Elsdoerfer
I am using a unique=True foreign key relationship to model inheritance, as suggested by the documentation. Say a TypedItem model that has a FK to BaseItem. Now I am in a situation where it would be really nice to be able to access the typed item from within the base item, e.g. the one row in

RE: TIME_ZONE setting: How does it work?

2007-08-19 Thread Michael Elsdoerfer
> To: django-users@googlegroups.com > Subject: Re: TIME_ZONE setting: How does it work? > > > On Sun, 2007-08-19 at 11:15 +0200, Michael Elsdoerfer wrote: > > I'm having some trouble with time zones on my production machine > (debian, > > apache prefork with

TIME_ZONE setting: How does it work?

2007-08-19 Thread Michael Elsdoerfer
I'm having some trouble with time zones on my production machine (debian, apache prefork with mod_python). On Windows, everything works as expected. I'm running the trunk from maybe two weeks ago. Basically, I have TIME_ZONE = 'GMT+1', but while datetime.datetime.today() in a vanilla python

RE: Support for macros in templates

2007-08-11 Thread Michael Elsdoerfer
> If interested, take the library from here: > http://www.djangosnippets.org/snippets/363/ Interesting. I too was missing macro support, and implemented something similar a couple weeks ago: http://www.djangosnippets.org/snippets/343/ Michael > -Original Message- > From:

RE: Only save if changed?

2007-08-04 Thread Michael Elsdoerfer
> def save(self): > if self.id is not None: > old_self = self.__class__.get(id = self.id) > if self.id is None or (old_self.city != self.city) or ( > old_self.state != self.state): > self.geocode = self.get_geocode() > super(SiteUser, self).save() You can also

RE: how to overcome {% if %} limitation

2007-07-31 Thread Michael Elsdoerfer
> 2) create custom tag. Some people have already done this of course, for example: http://www.djangosnippets.org/snippets/130/ Michael > -Original Message- > From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] > On Behalf Of [EMAIL PROTECTED] > Sent: Tuesday, July 31, 2007

RE: Is cloning Facebook in Django feasible?

2007-07-27 Thread Michael Elsdoerfer
> And yes, facebook has been cloned in other countries, many, many times. > The most famous one is from china: http://xiaonei.com/ Not only did > they clone the features, they cloned the interface. It even got > acquired for lots of money. Or in Germany StudiVZ, which also got acquired. As