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

2008-08-26 Thread John Lenton
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]) -- Random fortune:

Re: Regex assistance

2008-07-01 Thread John Lenton
module > > 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 a l

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

2008-05-14 Thread John Lenton
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 ([EMAIL PROTECTED]

Re: Building filter strings dynamically

2008-05-09 Thread John Lenton
ning, > 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'} qry = qry.filter(**filter) -- John Lenton ([EMAI

Re: Combating submission form Spam

2007-12-05 Thread John Lenton
curate 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
mentation, 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. --~--~-~--~~~---~--~~ You

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

2007-08-13 Thread John Lenton
et 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 instead of

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-made men

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 wi

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. -- John Lenton (

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
abase: 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 trouble with a lot of se

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
u 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 Google Groups

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

2006-12-04 Thread John Lenton
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 Lenton ([EMAIL PROTECTED]) -- R

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

Re: directed graph in default admin

2006-10-27 Thread John Lenton
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 self-made men

Re: directed graph in default admin

2006-10-26 Thread John Lenton
| 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 bug in django, or am

directed graph in default admin

2006-10-24 Thread John Lenton
ay = ['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 fortune: The trouble with a lot

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 of self-made men is t