TemplateSyntaxError exception catches all the rest

2008-04-04 Thread Simone Cittadini
When my app throws some exception I'm no more viewing the nicely formatted html. Actually I'm no more viewing the trace of the exception, all I see, no matter what the error is, is attached below: (I haven't played with settings.py and I don't think is something in my code, it happens with

IDE (UML )

2008-03-07 Thread Simone Cittadini
Since there's an active discussion about ide .. Back in my java days I was using eclipse with omondo for uml, I really miss the uml drawings, someone has some plugin to suggest ? I've no need for fancy features, just something to draw class and sequence diagrams, project is becoming huge and

Re: IDE

2008-03-07 Thread Simone Cittadini
Tom Badran ha scritto: > Do people find eclipse+pydev reliable? I've tried it out a few times > over the last year and it never seems to run for more than a few hours > without dying. This is both the 3.2 (from eclipse.org > and ubuntu packaged) and 3.3 (from eclipse.org

assertTemplateUsed -> No templates used to render the response

2007-12-21 Thread Simone Cittadini
I'm doing some "poke around" tests just to get used to the framework, this error I can't understand : Wrote a login view : user = auth.authenticate(username=request.POST['username'], password=request.POST['password']) if user is not None: if

Re: creating user and profile in just one form

2007-12-11 Thread Simone Cittadini
j > > On Dec 10, 5:15 am, Simone Cittadini <[EMAIL PROTECTED]> wrote: > >> I have this code to add a new user : >> >> class CustomerForm(ModelForm): >> >> class Meta: >> model = CustomerProfile >> >> def add(request): >&

creating user and profile in just one form

2007-12-10 Thread Simone Cittadini
I have this code to add a new user : class CustomerForm(ModelForm): class Meta: model = CustomerProfile def add(request): [..] if request.method == 'POST': form = CustomerForm(customer, request.POST) f.save() else: form =

Re: ChoiceField get choices from objects.all(), but isn't updated

2007-11-02 Thread Simone Cittadini
Malcolm Tredinnick ha scritto: > On Fri, 2007-11-02 at 11:25 +0100, Simone Cittadini wrote: >> >> class FormFilters(forms.Form): >> filter_name = forms.ChoiceField(choices = [(f.name, f.name) for f in >> Filter.objects.all()]) >> >> >>

ChoiceField get choices from objects.all(), but isn't updated

2007-11-02 Thread Simone Cittadini
Stripping down my app to what isn't working as expected I have : models : class Filter(models.Model): name = models.CharField() object = models.ManyToManyField(Object) class Object(models.Model): name = models.CharField() [...] forms : class FormFilters(forms.Form):

About the absence of double primary key ...

2007-10-12 Thread Simone Cittadini
I was wondering if the limit on one primary key field only was coming out of the "encouraging of clean design" or was just a technical limitation. I have some classes in my "legacy" app that are uniquely identified by two or more attributes, and I was just catching db layer exception when the

manage.py test can't find the fixtures

2007-10-11 Thread Simone Cittadini
I have this directories structure site/app_one/models.py site/app_one/tests.py site/app_one/fixtures/test.json if I 'manage.py loaddata test' it works if I 'manage.py test' it doesn't find fixtures the test class starts with : import unittest from models import * class

overriding FileField.save() to do something with the file

2007-10-04 Thread Simone Cittadini
I have such a Model : class FileToProcess(models.Model): file = models.FileField(upload_to='somewhere') def save(self): super(FileToProcess, self).save() f = open([???], 'r') for line in f.read(): How I get the name/path oh the "just saved"

Re: Creating a Form with some uneditable fields

2007-10-02 Thread Simone Cittadini
Was a "look all the fields type before asking problem" ... I've solved with HiddenField and disabled option ... class RuoteForm(forms.Form): line_name = forms.ChoiceField(choices=get_lines(), widget=forms.HiddenInput) prefix = forms.ChoiceField(choices=get_prefixes(),

Creating a Form with some uneditable fields

2007-09-20 Thread Simone Cittadini
I have some models like : class UserOfSomeStuff(models.Model): [...] class AvailableStuffToUse(models.Model): [...] class CurrentlyUsedStuff(models.Model): user = models.ForeignKey(UserOfSomeStuff) used_stuff = models.ForeignKey(AvailableStuffToUse) In my application I don't