Re: Template - different layout for odd/even items

2008-05-07 Thread John Melesky
I think the tag you're looking for is "cycle": http://www.djangoproject.com/documentation/templates/#cycle That's most convenient when interfacing with CSS stuff, so you could do something like: > {% for menuitem in paginator.object_list %} > which would put your in a different class

Re: Trouble running dev server after upgrade to Leopard.

2008-03-26 Thread John Melesky
On Mar 26, 2008, at 3:08 PM, Emil wrote: > Is there a way for me to know which python interpreter is used by > manage.py? Try invoking the django shell ("manage.py shell"), and then checking sys.executable. Looks something like this on my machine: $ ./manage.py shell Python 2.5 (r25:51918,

Re: django, flup, and googlebot

2007-09-20 Thread John Melesky
On Sep 20, 2007, at 10:50 AM, Darrin Thompson wrote: > I'm running lighttpd, flup, and django 0.96. I'm running similar, but django trunk. > So I tried to be the bot and looked at what it would have seen: > > $ curl -s -I http://.com/HTTP/1.1 200 OK > Vary: Cookie > Content-Type: text/html;

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread John Melesky
On Aug 27, 2007, at 2:05 AM, Kugutsumen wrote: > cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' > """ > % domain) > row = cursor.fetchone() If you do just need those two fields, and no object methods, you can use the "values" queryset method. Something like: d =

Re: Using Django to generate Flash/Flex content

2007-08-14 Thread John Melesky
On Aug 14, 2007, at 1:11 PM, SamFeltus wrote: > I don't understand why none of the major Python frameworks embrace > Flash/Flex wholeheartedly, especially with innovations such as > Papervision3D, which will happen in HTML when monkeys fly. Unlike HTML, SWF is essentially executable bytecode for

Re: Callable hooks for generic views after validation with no errors?

2006-10-05 Thread John Melesky
James Bennett wrote: > On 10/4/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >> There is some documentation on how Django's signals system works and how >> to hook into it here: http://code.djangoproject.com/wiki/Signals > > I just went through and completely re-wrote that to cover signals

Re: Off Topic: Mac software for database design?

2006-08-04 Thread John Melesky
Rob Hudson wrote: > I've seen some screencasts of various web frameworks (rails, > turbogears) where the user has a nice interface to a mysql admin tool > for creating tables, running queries, etc on a Mac. I can't find a > reference anywhere to what this might be. I downloaded and tried MySQL

Re: Harness our collective opinions -- Digg Django

2006-06-06 Thread John Melesky
Adrian Holovaty wrote: > The IBM Developer Works article about Django is a good opportunity to > get us some more exposure. If you have a Digg account (digg.com), Digg > it! Also on reddit (reddit.com): http://programming.reddit.com/info/7bzf/comments -johnn

Re: 'str' object has no attribute 'write'

2006-05-25 Thread John Melesky
mary wrote: > and i got this error > 'str' object has no attribute 'write' ... > output = ', '.join([m.menu_text for m in latest_menu_list]) > output.write(output) In the first line there, you're setting "output" (which used to be a file object) to a string, and then in the next line