Re: FormWizard and __call__

2008-04-11 Thread Jay Parlar
On 4/11/08, Honza Král <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 4:15 PM, Jay Parlar <[EMAIL PROTECTED]> wrote: > > Currently when we call get_form(i, request.POST) in __call__, we just > > arbitrarily recreate the Form instance. What if on the first time we > > create that instan

Re: FormWizard and __call__

2008-04-11 Thread Honza Král
On Fri, Apr 11, 2008 at 4:15 PM, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On Fri, Apr 11, 2008 at 8:03 AM, Honza Král <[EMAIL PROTECTED]> wrote: > > you could perhaps postpone the validation of data till the end of the > > wizard, so only run this once, but that could cause problems for > >

Re: Proposal: Form rendering with filters

2008-04-11 Thread Brian Beck
On Mar 18, 5:45 pm, "Joseph Kocherhans" <[EMAIL PROTECTED]> wrote: > I have been pretty unhappy about the way html has been generated from > newforms for awhile now. I think we've come up with a good design that > makes form rendering a lot easier, and a lot more modular. The basic > idea is to r

Re: Improve Error Handlers

2008-04-11 Thread Brian Beck
On Apr 11, 4:26 pm, Brian Beck <[EMAIL PROTECTED]> wrote: > Just a documentation note -- I can't really tell how to use those > features from this page.  Are those keyword arguments to urlpatterns? > Functions I call in the pattern list?  An example would be helpful. (Replying to myself.) Looki

Re: Improve Error Handlers

2008-04-11 Thread Brian Beck
On Apr 11, 2:51 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 11:34 AM, David Cramer <[EMAIL PROTECTED]> wrote: > >  404_HANDLER = 'django.generic.views.errors.404' > >  500_HANDLER = 'django.generic.views.errors.500' > > /me jumps in time machine: > > http://www.dja

Re: Template.render() should accept a dictionary, not just a Context object

2008-04-11 Thread Simon Willison
On Apr 11, 4:49 pm, "Rajeev J Sebastian" <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 8:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote: > > > def render(self, context): > > "Display stage -- can be called many times" > > if not isinstance(context, Context): > > context =

Re: [Proposal] Improve Error Handlers

2008-04-11 Thread Jacob Kaplan-Moss
On Fri, Apr 11, 2008 at 11:34 AM, David Cramer <[EMAIL PROTECTED]> wrote: > 404_HANDLER = 'django.generic.views.errors.404' > 500_HANDLER = 'django.generic.views.errors.500' /me jumps in time machine: http://www.djangoproject.com/documentation/url_dispatch/#handler404 http://www.djangoproject.

Re: Improve Error Handlers

2008-04-11 Thread David Cramer
Alright, it seems this already sort of exists, ignore me ;) On Apr 11, 11:34 am, David Cramer <[EMAIL PROTECTED]> wrote: > I'd like to offer a solution to many problems I've had, directing the > error handlers where I want them to go: > > - I want to be able to choose what templates they render >

[Proposal] Improve Error Handlers

2008-04-11 Thread David Cramer
I'd like to offer a solution to many problems I've had, directing the error handlers where I want them to go: - I want to be able to choose what templates they render - I want them to be able to work with Jinja ;) I was thinking that something along the lines of this could be done: 404_HANDLER

Re: Template.render() should accept a dictionary, not just a Context object

2008-04-11 Thread Marty Alchin
On Fri, Apr 11, 2008 at 12:02 PM, Patryk Zawadzki <[EMAIL PROTECTED]> wrote: > Why not use the opposite test and check for instances of dict? Because then you have to pass something that subclasses dict instead of something that implements the interface of dict. We could go on and on about this

Documentation micro-sprint this weekend

2008-04-11 Thread Jacob Kaplan-Moss
Howdy folks -- So I'm just about ready to need some help pushing through the documentation refactor. I'd like to get this done this weekend so I can get the new docs out next week; I'll need some volunteers to make that happen. It'll basically involve going through documentation adding metadata (

Re: Template.render() should accept a dictionary, not just a Context object

2008-04-11 Thread Patryk Zawadzki
On Fri, Apr 11, 2008 at 5:49 PM, Rajeev J Sebastian <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 8:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote: > > > > def render(self, context): > > "Display stage -- can be called many times" > > if not isinstance(context, Context): > >

Re: Template.render() should accept a dictionary, not just a Context object

2008-04-11 Thread Rajeev J Sebastian
On Fri, Apr 11, 2008 at 8:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote: > > def render(self, context): > "Display stage -- can be called many times" > if not isinstance(context, Context): > context = Context(context) > return self.nodelist.render(context) > > This is backw

Template.render() should accept a dictionary, not just a Context object

2008-04-11 Thread Simon Willison
Here's something that has been quietly bugging me about Django for / years/: Context() is an implementation detail of the template engine. Having to instantiate a Context just to pass it to render() is unnecessary boilerplate (and means you have to import another symbol as well). Template.render

Re: new to django / web development altogether

2008-04-11 Thread Patryk Zawadzki
2008/4/11 joyanta <[EMAIL PROTECTED]>: > > Hi, > > I am pretty much a server side and thick client software developer > trying to get into web programming, and would like to know more on > Django. I am slowly going through the tutorials etc. I am trying to > figure out which technology to use;

new to django / web development altogether

2008-04-11 Thread joyanta
Hi, I am pretty much a server side and thick client software developer trying to get into web programming, and would like to know more on Django. I am slowly going through the tutorials etc. I am trying to figure out which technology to use; what criteria one needs to look into before picking a t

Re: add support for unicode-normalizing get/post-data?

2008-04-11 Thread J. Cliff Dyer
On Thu, 2008-04-10 at 20:26 +0200, Gábor Farkas wrote: > On Thu, Apr 10, 2008 at 06:44:35AM -0700, simonb wrote: > > > > On Apr 10, 2:48 pm, Gábor Farkas <[EMAIL PROTECTED]> wrote: > > > hi, > > > > > > would it be a good idea to add support to django to unicode-normalize > > > incoming get/post-

Re: FormWizard and __call__

2008-04-11 Thread Jay Parlar
On Fri, Apr 11, 2008 at 8:03 AM, Honza Král <[EMAIL PROTECTED]> wrote: > you could perhaps postpone the validation of data till the end of the > wizard, so only run this once, but that could cause problems for > example if the user chose to override process_step and do something > based on the

Re: FormWizard and __call__

2008-04-11 Thread Honza Král
On Fri, Apr 11, 2008 at 4:10 AM, Jay Parlar <[EMAIL PROTECTED]> wrote: > > I originally posted this in -users, but since it deals with internals, > maybe it's more appropriate for -dev. > > I'm looking at the FormWizard code, and in __call__, we have the following: > > for i in range(current_st

Re: new-forms admin shouldn't throw error when a model is registered twice #6776

2008-04-11 Thread Russell Keith-Magee
On Fri, Apr 11, 2008 at 5:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote: > > http://code.djangoproject.com/ticket/6776 > > newforms-admin raises an AlreadyRegistered exception if you attempt to > register a model with admin.site twice. Unfortunately, due to the > different places and ways in

Re: new-forms admin shouldn't throw error when a model is registered twice #6776

2008-04-11 Thread NickFitz
On Apr 11, 11:47 am, mrts <[EMAIL PROTECTED]> wrote: > As double imports should be considered harmful, I'd rather see a > better warning there, in the lines of ""The model Foo is already > registered. This can be caused by a double import, see docs/bar.txt > for ways to avoid it." Just wondering:

Re: new-forms admin shouldn't throw error when a model is registered twice #6776

2008-04-11 Thread mrts
As double imports should be considered harmful, I'd rather see a better warning there, in the lines of ""The model Foo is already registered. This can be caused by a double import, see docs/bar.txt for ways to avoid it." (Double imports are triggered by mixing relative and absolute imports, e.g. i

new-forms admin shouldn't throw error when a model is registered twice #6776

2008-04-11 Thread Simon Willison
http://code.djangoproject.com/ticket/6776 newforms-admin raises an AlreadyRegistered exception if you attempt to register a model with admin.site twice. Unfortunately, due to the different places and ways in which a models.py file can be imported it's extremely easy to trigger this accidentally,