Re: how do change TextField size on form?

2007-04-05 Thread BrandonC
The newforms module isn't tied to the models, but you can easily create a form from a model using the helper function from_from_model. So in your view: from django import newforms from models import YourModel def some_view(request): form_class = newforms.form_from_model(YourModel) #Modify t

Re: Adding an error to an empty error list with newforms?

2007-04-05 Thread BrandonC
Oliver, form['fieldname'] returns a Field class object. To add an error to that you want to do form.errors['fieldname'] = ['Your list of errors messages']. If you also want to preserve other possible errors you'll want to us form.errors.setdefault('fieldname', []).append('Your error here.') ins

Re: Django IDE

2007-04-05 Thread BrandonC
As a comparison I have to say that Wing IDE has a very nice Python debugger (fast and it works). I haven't used Komodo in a while but I remember my biggest issue with it was that its debugger stopped at exceptions that truely were handled, and that it was slow. For django I set my manage.py file

Re: Help with Django base template and CSS

2006-03-04 Thread BrandonC
(r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': 'path/to/document/root/media', 'show_indexes': True}), As a temporary measure you can add a line like this to your urls.py in order to serve media when developing, replacing the path line with an absolute path to your media. Idea