Re: ModelForms

2007-11-07 Thread James Bennett
On Nov 7, 2007 10:26 PM, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > ModelForm would be a declarative class that requires, at minimum, a > model attribute. Other attributes would include: > > - formfield_callback (a function that takes a db field and **kwargs > and returns a form field or None)

ModelForms

2007-11-07 Thread Joseph Kocherhans
form_for_model and form_for_instance seem like complicated and clever ways to accomplish what basically boils down to a form that has a save method and can accept a model instance in its constructor method. I propose we (or I rather) actually build it that way before 1.0. Form declaration:

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Jonathan Buchanan
Kenneth Gonsalves wrote: > > On 08-Nov-07, at 6:47 AM, Kenneth Gonsalves wrote: > >>> Django bells, Django bells, >>> Django all the way; >>> Oh what fun it is to code >>> In a well-designed dynamic language! >> In an open source way! > > All night and day! > Until next Saturday. Jonathan.

Re: An addendum to the escaping proposals

2007-11-07 Thread Amit Upadhyay
Hi, I just switched on the middleware and all my ajax post actions are broken now. I am going to dive in the source and try to figure out how to generate enough token that I can embed in the page on page load, so that all my requests go fine. I would appreciate some tips if someone can tell me if

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Marty Alchin
On 11/7/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 08-Nov-07, at 6:47 AM, Kenneth Gonsalves wrote: > > >> Django bells, Django bells, > >> Django all the way; > >> Oh what fun it is to code > >> In a well-designed dynamic language! > > > > In an open source way! > > All night and da

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread Marty Alchin
On 11/7/07, SmileyChris <[EMAIL PROTECTED]> wrote: > Actually, I see no good reason why you shouldn't be able to use a Form > as the SuperClass of your form_for_* form. Yeah, I was trying avoid the issue of "should" of "shouldn't" and just point out what was going on. -Gul --~--~-~--~--

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Kenneth Gonsalves
On 08-Nov-07, at 6:47 AM, Kenneth Gonsalves wrote: >> Django bells, Django bells, >> Django all the way; >> Oh what fun it is to code >> In a well-designed dynamic language! > > In an open source way! All night and day! -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/we

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Kenneth Gonsalves
On 08-Nov-07, at 2:36 AM, Jacob Kaplan-Moss wrote: > Django bells, Django bells, > Django all the way; > Oh what fun it is to code > In a well-designed dynamic language! In an open source way! -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~--

Re: An addendum to the escaping proposals

2007-11-07 Thread Malcolm Tredinnick
On Wed, 2007-11-07 at 19:11 -0600, James Bennett wrote: > On Nov 7, 2007 7:08 PM, James Bennett <[EMAIL PROTECTED]> wrote: > > Which means that this basically boils down to an annoyance attack, > > changing a user's password without their knowledge. But that's already > > exposed to anyone who can

Re: An addendum to the escaping proposals

2007-11-07 Thread James Bennett
On Nov 7, 2007 7:08 PM, James Bennett <[EMAIL PROTECTED]> wrote: > Which means that this basically boils down to an annoyance attack, > changing a user's password without their knowledge. But that's already > exposed to anyone who can guess the user's email address, so anyone > who simply wants to

Re: An addendum to the escaping proposals

2007-11-07 Thread James Bennett
On Nov 7, 2007 5:22 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I have quite a different view about the severity of this. Out of the > box, Django has a CSRF vulnerability if you use admin. I'm not inclined > to dismiss this as a nothing event that you can work around by somehow > magicall

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread SmileyChris
On Nov 8, 4:30 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > When you pass in a subclass of Form, it's already got its fields in > the right place, but more importantly, it triggers that syntax > checking again, where it looks for new fields. It basically copies > fields from a parent class, the

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Marc Fargas
Hi ppl, I was looking at SprintIdeas on the wiki and did a bit of cleanup at the bottom. I think we could find a more "agile" way to handle the "Results" part of the page, the way it's done now means that when you edit the ticket during the sprint you then have to edit the wiki page to reflect it

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Marty Alchin
On 11/7/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > Yeah, we wanted to get one in before PyCon, and it turnned out that > Dec. 1st was going to be the only time we could slide it in. Especially since I see Malcolm's going to be there in person. That's gotta be tough to plan around. > We *

Re: An addendum to the escaping proposals

2007-11-07 Thread Malcolm Tredinnick
On Wed, 2007-11-07 at 11:08 -0600, James Bennett wrote: > If/when we ever do finally sit down and implement an auto-escaping > proposal, I'd like to suggest we also just go ahead and turn on the > CSRF middleware by default, because apparently the fact that it isn't > enabled by default is leading

Re: Templates: {% trans %} {% some_tag _() %} and {{ _() }} what gives?

2007-11-07 Thread Dmitri Fedortchenko
I guess I got a little too excited over this ;-) As for the variable resolution bug, could it be related to this*: http://code.djangoproject.com/ticket/5885 or am I on the wrong track? //D * shameless plug On 11/8/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Wed, 2007-11-07 at 13:

Re: Templates: {% trans %} {% some_tag _() %} and {{ _() }} what gives?

2007-11-07 Thread Malcolm Tredinnick
On Wed, 2007-11-07 at 13:01 +, Dmitri Fedortchenko wrote: > I am trying to figure out the state of the translation tags in the > django template system. > > My ticket has been rejected, but I am not satisfied with the RTFM > answer given there, based on the claim that python-stuff should not

Templates: {% trans %} {% some_tag _() %} and {{ _() }} what gives?

2007-11-07 Thread Dmitri Fedortchenko
I am trying to figure out the state of the translation tags in the django template system. My ticket has been rejected, but I am not satisfied with the RTFM answer given there, based on the claim that python-stuff should not work in the template system. So why then do the i18n docs state that {%

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Jacob Kaplan-Moss
On 11/7/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > Dang it! Why do you guys always plan sprints on days I already have > something planned? Couldn't you at least check with me first? :) Only > joking. It's great to hear that there's another sprint. I didn't > expect another one until PyCon in M

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Marty Alchin
On 11/7/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > We'll hold the sprint Saturday, December 1st here in Lawrence, KS, and > virtually around the world. Dang it! Why do you guys always plan sprints on days I already have something planned? Couldn't you at least check with me first? :) Only

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
Interesting, I'll have a look at it after this project is done hehe. I totally understand and am simply throwing ideas around. However it seems that things are already moving in that direction. :) Thanks for the link. //D On 11/7/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > > On 11/7/07,

Re: ANN: Django sprint, December 1st

2007-11-07 Thread Jacob Kaplan-Moss
On 11/7/07, David Reynolds <[EMAIL PROTECTED]> wrote: > Hurrah! Sprinting in the holiday season! ;) Django bells, Django bells, Django all the way; Oh what fun it is to code In a well-designed dynamic language! [OK, so the last line doesn't scan. Whatever.] Jacob --~--~-~--~~--

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Joseph Kocherhans
On 11/7/07, Dmitri Fedortchenko <[EMAIL PROTECTED]> wrote: > > The Admin class should be able to define post_ and pre_save hooks that are > called before or after all Manipulation of the model is done (there are > post_save hooks for the save method, but they are still called before the > Manipula

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
Perhaps. However I believe that customization of the admin is not a bad thing. On the contrary it allows people to use it for most everything that they need without having to write duplicate code... One such thing is the thread_locals hack for created_by/updated_by... Imagine if you wanted to dyn

Re: ANN: Django sprint, December 1st

2007-11-07 Thread David Reynolds
Jacob Kaplan-Moss wrote: > Howdy folks -- > > We had such a great time doing that last sprint, so we're doing it again! > > We'll hold the sprint Saturday, December 1st here in Lawrence, KS, and > virtually around the world. We'll run things much the same as we did > last time: Hurrah! Sprintin

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Collin Grady
Dmitri Fedortchenko said the following: > Well django does recommend using the admin for everything admin-related, > if I stop using the admin for editing an article, then I would have to > write a whole bunch of code just to edit a single article. Suddenly the > benefit of a unified admin interfa

ANN: Django sprint, December 1st

2007-11-07 Thread Jacob Kaplan-Moss
Howdy folks -- We had such a great time doing that last sprint, so we're doing it again! We'll hold the sprint Saturday, December 1st here in Lawrence, KS, and virtually around the world. We'll run things much the same as we did last time: We plan to devote at least 24 hours of focused work to

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
Well django does recommend using the admin for everything admin-related, if I stop using the admin for editing an article, then I would have to write a whole bunch of code just to edit a single article. Suddenly the benefit of a unified admin interface is lost and I have to deal with permissions, U

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Collin Grady
Dmitri Fedortchenko said the following: > Still, the most logical course is to override the save method. I'd say the more logical course is to stop using admin for this ;) -- Collin Grady QOTD: "If I'm what I eat, I'm a chocolate chip cookie." --~--~-~--~~~

Re: An addendum to the escaping proposals

2007-11-07 Thread SmileyChris
On Nov 8, 6:08 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > If/when we ever do finally sit down and implement an auto-escaping > proposal, I'd like to suggest we also just go ahead and turn on the > CSRF middleware by default Why do those two have to be tied together? How about we just def

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread Marty Alchin
On 11/7/07, David Larlet <[EMAIL PROTECTED]> wrote: > Unfortunately, what happens with my Form is exactly what I'd like to do: > create a generic form from a Form class which define fields (with > widgets, etc) and methods and which is initialized with the content of > the instance. That seemed mo

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread David Larlet
Marty Alchin a écrit : >>> On 11/7/07, David Larlet <[EMAIL PROTECTED]> wrote: >>> Hi all, I'd spent a long time finding that bug but I want to be sure before submitting it on Trac. If you pass a form argument to form_for_instance like that: forms.form_for

An addendum to the escaping proposals

2007-11-07 Thread James Bennett
If/when we ever do finally sit down and implement an auto-escaping proposal, I'd like to suggest we also just go ahead and turn on the CSRF middleware by default, because apparently the fact that it isn't enabled by default is leading people to scream about security vulnerabilities in Django[1], w

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread Marty Alchin
> > On 11/7/07, David Larlet <[EMAIL PROTECTED]> wrote: > >> Hi all, > >> > >> I'd spent a long time finding that bug but I want to be sure before > >> submitting it on Trac. If you pass a form argument to form_for_instance > >> like that: > >> > >> forms.form_for_instance(foo, form=FooForm) > >>

Earn Money Online! No Registration Fees. Guaranteed Payments.

2007-11-07 Thread Riaz Muhammad
http://www.moneycosmos.com/?r=321740 --~--~-~--~~~---~--~~ 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 from this group, s

IF you want earning easy money click on the link below!

2007-11-07 Thread Riaz Muhammad
http://www.freewebs.com/homebusiness1 --~--~-~--~~~---~--~~ 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 from this group,

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread David Larlet
I thought that it was more appropriated to post it on the devlist because it sounds like a bug but ok let's move it on the userlist, sorry for the noise here. I'll be glad to hear your solution. David Marty Alchin a écrit : > This should probably be asked on django-users, as it's more about ho

RE: Help with loader error

2007-11-07 Thread Cornett, Charles
Gary, To mix metaphors, sometimes it takes a second pair of eyes to make the lightbulb go off. I'm not sure how that got in there but I had already deleted several instances of "untitled folder" from the file. I just didn't recognize the name in the error code. Thanks. Charles _

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
That is what I thought as well, however I checked, and the _add_items() method is only called once with the correct objects (meaning the existing keywords and the keywords that I added). Are you telling me that the admin actually has it's own method for setting the relationships that is outside t

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
I see it now. Collin was absolutely right. After the new keywords are added, the related.clear() method is called and the admin adds it's own keywords, thus erasing any changes. So it all boils down to the django.models.manipulators.AutomaticManipulator:128 I totally get it, I've solved m2ms i

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread Marty Alchin
This should probably be asked on django-users, as it's more about how to use form_for_instance() than any internal development. And yes, that means I don't believe it's a bug, and I'll gladly explain more on django-users so more people can hear it. -Gul On 11/7/07, David Larlet <[EMAIL PROTECTED

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
It seems that there is no way to make this work yet with the current admin. The idea is that when you are writing an article, you might mark certain words in that article to become keywords. When saving the article, these keywords are created (if they do not exist) and then added as m2ms to the a

form_for_instance and form argument, empty form?

2007-11-07 Thread David Larlet
Hi all, I'd spent a long time finding that bug but I want to be sure before submitting it on Trac. If you pass a form argument to form_for_instance like that: forms.form_for_instance(foo, form=FooForm) with an instance of foo which only contains a basic field (let's say a CharField) and FooF

Re: Overriding a Model's save() method does not allow proper creation of ManyToMany related objects

2007-11-07 Thread Dmitri Fedortchenko
Hi Basically I have followed the call all the way to the execution of the cursor.execute() on line 343 in models.fields.related. I have not actually delved into the transaction method. However in my setup I am using the django admin, I have not set up any automatic transaction handling and the s