Re: Form Select Selected Choice

2009-09-21 Thread Jim Myers
I too spent a day or so on this seemingly simple problem :( Here's my solution... class EMailAddressForm(forms.Form): emailType = forms.ChoiceField(required=True,choices=[]) def __init__(self, *args, **kwargs): super(forms.Form, self).__init__(*args, **kwargs) choices =

Re: ChoiceField with choices will NOT select initial value

2009-09-17 Thread Jim Myers
I'm passing a list because this is a formset, not a single form. That code is part of a view function so I didn't show the def: On Sep 17, 8:21 pm, Torsten Bronger <bron...@physik.rwth-aachen.de> wrote: > Hallöchen! > > On a second look, I see other things that may be problematic

ChoiceField with choices will NOT select initial value

2009-09-17 Thread Jim Myers
I'm spent hours reading docs and Googling for the solution to this problem to no avail. Running Django 1.1 with mod_wsgi I have a Form with a ChoiceField where the choices are established by reading them from the database. Then I try to initialize the initial selected choice so it will be

Re: How to server static media secured by Django authentication

2009-09-12 Thread Jim Myers
I had looked at that page before, but had thought it only applied to mod_python. Does it also apply to mod_wsgi? If so, the page could be made clearer. On Sep 11, 10:49 pm, Gabriel Gunderson <g...@gundy.org> wrote: > On Fri, Sep 11, 2009 at 3:03 PM, Jim Myers <myer...@gmail.com&g

How to server static media secured by Django authentication

2009-09-11 Thread Jim Myers
I have a requirement to serve static files only to users authenticated through Django secure login. That means I can't use apache basic/digest authentication for those files. So far in my searches of the web and Django docs, I've found no way to do this. Of course my alternative is to serve ALL

How to display and update selected fields from a model

2009-09-09 Thread Jim Myers
I have a database model with many fields, some of which I don't want displayed in a form and others I don't want to be editable. Is it possible to do this with a ModelForm? Or is it even possible with regular forms? Furthermore, I only want the SQL update statement to update ONLY the fields

Django + Dojo errors

2009-09-07 Thread Jim Myers
Hi, I'm using this code to create a response to an Ajax GET from a Dojo html page: @json_response def index_json(request): ret = {'data': [dict(name='Gary', age='24'), dict(name='Shane', age='29')]} return ret The actual text sent to the client is this: {}&&{"data":

Re: Need to replace Django User class

2009-09-07 Thread Jim Myers
OK, I think I got it to work now. I had to copy most of the stuff in contrib.auth.models.py also (which isn't really mentioned in the doc you mentioned about backends (which I had already read). --~--~-~--~~~---~--~~ You received this message because you are

Need to replace Django User class

2009-09-06 Thread Jim Myers
I've look all over docs and Google to find a way to do this with no real luck. I'm using a legacy PostGreSQL database which already has user and permissions tables defined, and I don't want to have to create parallel Django User tables. It seems simple that I should just be able to completely

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-06 Thread Jim Myers
My noob error: I had extra "portal/" on my regex. Sorry and thanks for your attention. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-05 Thread Jim Myers
Thanks, but that doesn't do it either. I changed the regex to: ^portal/student/(?P\S+)/profile_edit/$ and it still doesn't match :( On Sep 5, 9:44 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Sat, Sep 5, 2009 at 11:32 PM, Jim Myers <myer...@gmail.com> wrote: > > >

regex problem in urls.py in Django 1.1/mod_wsgi

2009-09-05 Thread Jim Myers
Hi, I'm using this regex in urls.py: r'^portal/student/(?P\S+)/profile_edit$' to try to match this url: http://dd..org/portal/student/xx.yy/profile_edit/ It's supposed to put "xx.yy" into userid parameter and match and use the associated view. But it doesn't match. I've banged my head