Request for comments on ticket 8122: better way of testing for cookies

2008-10-01 Thread Joost Cassee
Hi all, Now that the trunk is open for enhancements, I would like to ask the core developers for their opinion on ticket 8122: better way of testing for cookies [1]. Chris Beaven looked at the ticket and suggested I bring it up here to solicit comments. The ticket addresses the awkward set_test_

Re: Proposal: refactoring URL resolution

2008-09-21 Thread Joost Cassee
On 17 sep, 02:14, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-09-15 at 14:10 -0700, Ken Arnold wrote: > > I previously brought up a URL resolution refactoring (http:// > > groups.google.com/group/django-developers/browse_thread/thread/ > > e16bcd24f9e27062/a84b8e58fe2e7786), and w

Re: '"%s/" % var' preferred to 'var + "/"'?

2008-08-22 Thread Joost Cassee
Thanks for all the great info. Usually articles refer ''.join(...) as the fastest concat operation, but it won't do type coersion of course. I was interested whether there was a Django standard for this sort of thing. In any case the '+' operator is discouraged by all. Regards, Joost --~--~-

'"%s/" % var' preferred to 'var + "/"'?

2008-08-21 Thread Joost Cassee
Hi all, Just a quick question to set my head right for future Django contributions. Why is "%s/" % var better than var + '/'? I can think of some reasons: 1) consistency with other code, 2) certainty of string concatenation. But is the second expression not much faster? (This is an honest questio

Localizing digits

2008-08-18 Thread Joost Cassee
Hi all, A Farsi-localized Django site I'm working on will need Farsi digits, so I'm looking for a solution for replacing digits with their localized counterparts. The GNU gettext has support for localized digits using the 'I' flag on numerical format variables, e.g. "%Id". Unfortunately this wor

Re: would is_loggedin be better than is_anonymous?

2008-07-17 Thread Joost Cassee
On 17 jul, 02:05, "Robert Coup" <[EMAIL PROTECTED]> wrote: > Its not that hard to handle... > > 1. Have long-lived sessions: >  - if there isn't a user associated: "anonymous" >  - if it has a user: "known" > > 2. When a user logs in (ie. types their username and password): >  - add the user refe

Re: ANN: newforms-admin syntax change for inlines

2008-07-16 Thread Joost Cassee
Hi all, On 9 sep 2007, 14:36, "Honza Král" <[EMAIL PROTECTED]> wrote an example newforms-admin snippet that would programmatically add an inline: > class CommentOptions( models.Model ): >   enabled = models.Fireld() >   moderators = models.Field() >   ... > > for model, model_options in admin.si

Re: would is_loggedin be better than is_anonymous?

2008-07-16 Thread Joost Cassee
On 14 jul 2006, 23:53, "SmileyChris" <[EMAIL PROTECTED]> wrote: > Hrm... > Will there ever be a difference between "user.is_anonymous" and "not > user.is_authenticated"? > If not (and I can't think of a reason), do we really need to keep > is_anonymous? I would like to present a case for such a d