Re: value taken through textarea is being displayed in one line

2008-08-26 Thread John Lenton
ne breaks specifically. Luckily Django has a filter to do > this: linebreaks. So you just do {{ comment|linebreaks }} > > -- > DR > > > -- Sent from Gmail for mobile | mobile.google.com John Lenton ([EMAIL PROTECTED]) -- Rando

Re: Regex assistance

2008-07-01 Thread John Lenton
le > > local numbers start with 281, 832, 713 , or 1281, 1832, or 1713, my > regex which isnt working looks like this in other words, local numbers match the regex r'^(?:281|832|713|1281|1832|1713)' -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with

Re: accessing dictionary elements in opening tag of django template for loop

2008-05-14 Thread John Lenton
document.tags %} {{ doctag.tagid }} {% endfor %} {% endfor %} this is assuming there is some reason for you not to modify the Document class to give it the appropriate methods or attributes to access the related DocumentTag directly; if you could do that, life would be much easier :) -- John Lenton (

Re: Building filter strings dynamically

2008-05-09 Thread John Lenton
y happening, > since "sections__name__exact" doesn't have to be defined anywhere. > > But is there any way to build the parameter to the filter dynamically? the usual python way of building dynamic args: filter = {'sections__name__exact': 'shooting'}

Re: Combating submission form Spam

2007-12-05 Thread John Lenton
ate or up to date, although it looks about right; just saving you the google): http://chewpichai.blogspot.com/2007/10/how-to-integrate-recaptcha-with-django.html -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of self-made men is t

Re: order_by with foreign keys

2007-09-10 Thread John Lenton
documentation, mentioning the bug, and pointing to the ticket with the patch that fixes the bug, right? :-D -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of self-made men is that they worship their creator. --~--~-~--~~~---~--~~

Re: application/xhtml+xml MIME won't take

2007-08-13 Thread John Lenton
application/xhtml+xml for the pages > it serves? > > I tried changing the text/html entry in my mime.types file for apache > to application/xhtml+xml but that does squat. do you want to do that, given that a large portion of your (average) clients will now get a download dialog instea

Re: Encoding in models.py (and maybe other files too)

2007-04-18 Thread John Lenton
asking :) I don't know about Nicolas, but I'm writing something for a Spanish-speaking customer, so I might have a TelephoneField ("teléfono") in there, for example. -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of self

Re: newb: Newform conditional regexField

2007-03-16 Thread John Lenton
On 3/16/07, johnny <[EMAIL PROTECTED]> wrote: > > In newform, how do I allow a single regexField to accept either a > whole number, or number with decimal places? doesn't r"\d+(\.\d*)?" work? -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with

Re: Types of projects Django is not well suited for?

2006-12-29 Thread John Lenton
On 12/26/06, mamcxyz <[EMAIL PROTECTED]> wrote: - You can't do a single-exe deployment, except if discover a way to hack the thing very much I wouldn't be so sure. You could almost certainly use PyInstaller to build a sqlite-backed django app down to a single exe. -- Joh

Re: "Decimal not JSON serializable"?

2006-12-19 Thread John Lenton
te that as isinstance(key, (float, decimal.Decimal)) -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of self-made men is that they worship their creator. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: select_related() with the ForeignKey in the same table

2006-12-18 Thread John Lenton
ts of node A from the database: Node.objects.filter(path__startswith=A.path) the ugly thing is that now your database is denormalized, and your friends that teach Databases at the university will sneer. -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The

Re: Property overrides

2006-12-12 Thread John Lenton
On 12/12/06, Nathan R. Yergler <[EMAIL PROTECTED]> wrote: > > Note that the property built-in takes the "getter" as the first, > required argument and the "setter" as the optional, second argument. A nit: none of the arguments of property are required.

Re: Optimizing Templates

2006-12-07 Thread John Lenton
give you a better clue as to what is wrong... -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of self-made men is that they worship their creator. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-04 Thread John Lenton
This way it would be clear that max() returns a tuple (value, queryset) (to me, at least...). Also, ...groupby('foo').max() would return the same result as max(...groupby('foo')), but less efficiently. Talking through my hat? -- John L

Re: [patch] Generating slug for words with accents

2006-11-16 Thread John Lenton
On 11/16/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > German ß should be translated to ss > ä to ae > ö to oe > ü to ue but «ü» in Spanish should be just «u» (as in pingüino -> pinguino). -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lo

Re: directed graph in default admin

2006-10-27 Thread John Lenton
AMSPORT - AP ALDENE 13 KV SK NUG WESTERN HUB ALDENE 13 KV SK NUG WEST INT HUB ALDENE 13 KV SK NUG WELLSBORO which is exactly the same as the previous one, if you look :( -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of

Re: directed graph in default admin

2006-10-26 Thread John Lenton
expected: Source v | Sink Anode | Cnode Cnode | Bnode Mnode | Anode Xnode | Anode this is as expected; but if you click on "Sink", you get Source | Sink v Anode | Cnode Cnode | Bnode Mnode | Anode Xnode | Anode i.e., it still sorts by Source instead of Sink. Is this a

directed graph in default admin

2006-10-24 Thread John Lenton
Admin: list_display = ['source', 'sink'] -->8- that works very nicely. Or does it? The link on the sink column in the admin interface sorts by source :( What am I missing? Oh, python2.4, django from svn, linux. -- John Lenton ([EMAIL PROTECTED]) -- Random

Re: Batch record processing

2006-07-27 Thread John Lenton
return self.file[start+1:] umm.. os.path.basename() would probably be better than assuming '/' (or anything else) is the path delimiter, no? -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot o