Re: how to limit foreign key choices by current user?

2007-05-18 Thread jonathan_ou
Thanks that worked. Although I had to say EForm.base_fields['apple'] to make it work. On May 18, 2:48 am, Doug B <[EMAIL PROTECTED]> wrote: > You can't limit choice like that. The choices specified there are > evaluated only when the model is first evaluated (module load time). > > What yo

how to limit foreign key choices by current user?

2007-05-17 Thread jonathan_ou
Suppose I have a model class that has a foreign key field, something like the following: class example_model(models.Model): apple = models.ForeignKey(Apple) owner = models.ForeignKey(User) where Apple is created by authenticated users. So at any given time, there may be mult

Re: "'BoundField' object is unsubscriptable " error when trying to upload file

2007-05-13 Thread jonathan_ou
27;filename'] and that solved the problem. But I am still very confused as to why when I update request.FILES to form_data, it would transform the multi-valued dictionary into a list? Any clue? On May 12, 8:21 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 5/13/

"'BoundField' object is unsubscriptable " error when trying to upload file

2007-05-12 Thread jonathan_ou
I am trying to upload a file using the newforms library. So far from reading other posts and googling around it appears I have to copy the request.POST dictionary and update it with request.FILES. Then I would do a "model.save__file(, )" to actually save the file. Here's the code where I try to

Re: Tutorial part 4 IndexError

2007-04-13 Thread jonathan_ou
problem in django's > debug view. Could it be your sourcefile uses '\r' for end of line > where django expects a '\n' ?? > > On Apr 13, 8:12 am, "jonathan_ou" <[EMAIL PROTECTED]> wrote: > > > I am using python 2.5 with django 0.96 rev 5005 u

Tutorial part 4 IndexError

2007-04-12 Thread jonathan_ou
I am using python 2.5 with django 0.96 rev 5005 using mysql database. When I try to cast a vote via web forms in part 4 of the tutorial, I get the following error after I select a choice and submit the form: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versio