django messages framework

2011-09-30 Thread Anand Kumria
Hi, Sparked by a discussion with friends on common failing in web development, one common one is encoding HTML in the code. There are efforts underway to address this within core Django (related to widgets and forms) but a pattern I've noticed in some of my project is that messages in response

Re: User.objects.active() support.

2011-09-30 Thread tWoolie
The thing is that I believe django as a whole would benefit from this kind of functionality. The whole point of custom managers is to add functionality, not just to your app, but to every app that FKs against your models. In the case of contrib.auth, this functionality is really handy spanning

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-30 Thread Florian Apolloner
Hi, On Friday, September 30, 2011 2:22:12 AM UTC+2, Ramiro Morales wrote: > > On Thu, Sep 29, 2011 at 8:43 PM, Luke Plant wrote: > > Hi all, > > > > r16568 [1] added SimpleTemplateResponse.__getattr__ as part of a fix for > > #16326 [2]. > > > > There is one obvious bug in

Re: User.objects.active() support.

2011-09-30 Thread Luke Plant
On 30/09/11 09:56, tWoolie wrote: > This is an example of the template code that I add to djangobb by > overriding it's templates. djangobb currently has no custom User > subclass that it injects into it's moderator relationship, and hence i > have to do a filter in the template, or modify

Re: prefetch_related - new feature suggestion

2011-09-30 Thread Luke Plant
On 29/09/11 21:40, Florian Apolloner wrote: > > > On Tuesday, September 27, 2011 11:37:06 PM UTC+2, Peter wrote: > > I'd just like to chime in to say this should definitely be part of > core - it's a common requirement, and whilst it could be a third party > app, it certainly feels

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-30 Thread Jannis Leidel
On 30.09.2011, at 01:58, Luke Plant wrote: > I wrote: > >> and in this case you would instead get >> this message: >> >> "The rendered_content attribute was discarded when this >> TemplateResponse class was pickled." >> >> which is completely false. > > ...which is completely false, so

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-30 Thread Ivan Sagalaev
Though the patch in the ticket does solve the problem I completely agree with removing the code altogether… I'm not a fan of "helpfully" reformulating exceptions while trying to be more specific. In practice it hurts more than it helps, and this case is just another confirmation. -- You

Module or plugin architecture

2011-09-30 Thread Tony
Hello, I am new to Django and I have a question about module or plugin architecture. Is it possible to write a module with Django and add it to a current Django application. Thank you very much. Regards, Tony -- You received this message because you are subscribed to the Google Groups "Django

Re: Module or plugin architecture

2011-09-30 Thread Jacob Kaplan-Moss
Hi Tony -- This is a question better suited for the django-users mailing list; django-developers is for discussion of developing Django itself, not usage questions. Thanks! Jacob -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post

Re: django messages framework

2011-09-30 Thread Gabriel Hurley
I'm a fan of the idea, with the caveat that it can't break any backwards-compatibility with the current syntax. As such, that could either entail reworking the current methods that add messages to accept a template string as a keyword argument (and making the positional "message" argument

Feature proposal: Q.push(...) and QuerySet.filter(relfield=Q(...))

2011-09-30 Thread Johannes Dollinger
The aim of this proposal is to reuse Q objects for models that are related through FK or M2M fields. A simplified example would be a Q object like >>> is_blue = Q(blue=True) >>> Thing.objects.filter(is_blue) that should be reused to filter the owners of things: >>>

How about doctype webdesign helper

2011-09-30 Thread Yaşar Arabacı
Hi, While going through documentation, I saw webdesign helpers, which I didn't know that even existed. I thought about adding new things there, so I thought about doctype helper, something like this: {% doctype "html" "4.1" "strict" %} which is then rendered like this:

Re: prevent brute force attacks by acting on several failed logins, for example by using a captcha

2011-09-30 Thread Wim Feijen
Hello, Thanks for the pointers. Based on the previous discussion and the comments at Simon Willison's blog on ratelimitcache, here is a first draft of my proposal: 1. Considering that Django's admin and default login schemes are currently unprotected against brute force attacks by default, and

Re: django messages framework

2011-09-30 Thread Wim Feijen
Using render_to_string, you can use a template, and it is backwards compatible. Would that work? Wim -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe

Re: prefetch_related - new feature suggestion

2011-09-30 Thread Luke Plant
On 29/09/11 21:43, Alex Gaynor wrote: > When I did this externally a number of years ago, I basically subclassed > ManyToManyField, overrode a bunch of code (quite a bit of copy paste as > I recall), and it's related manager and made it return a custom > queryset, which used a cache off of the

Re: How about doctype webdesign helper

2011-09-30 Thread Russell Keith-Magee
On Saturday, October 1, 2011, Yaşar Arabacı wrote: > Hi, > While going through documentation, I saw webdesign helpers, which I didn't know that even existed. I thought about adding new things there, so I thought about doctype helper, something like this: > {% doctype "html"

Re: Feature proposal: Q.push(...) and QuerySet.filter(relfield=Q(...))

2011-09-30 Thread Calvin Spealman
On Fri, Sep 30, 2011 at 5:37 PM, Johannes Dollinger wrote: > The aim of this proposal is to reuse Q objects for models that are related > through FK or M2M fields. > A simplified example would be a Q object like > >    >>> is_blue = Q(blue=True) >    >>>