Re: Can a method call inside save() display its return on template?

2012-07-19 Thread Marilena Papageorgiou
get_direction_descr does something like this: def get_direction_descr(nod_id1, nod_id2): cursor = connection.cursor() cursor.execute("SELECT GetDirectionDescr("+str(nod_id1)+","+str(nod_id2)+") from sys.dual") result = cursor.fetchall() return result[0][0]

"Cannot convert

2012-07-11 Thread Marilena Papageorgiou
I have a django modelForm that it was being submitted successfully until I added this code in my forms.py: def __init__(self, own_id=None, **kwargs): super(WebrequestsForm, self).__init__(**kwargs) if own_id: self.fields['veh_id1'].queryset = Vehicles.objects.filter(own

rendering modelForms

2012-07-09 Thread Marilena Papageorgiou
Hi! In my django app I'm using modelForms and not simple django forms so in order to render the form I just do {{ form.as_table }} an the template and everything is being displayed. That's simple, but obviously any html code is being skipped, so I wonder how will I further customize my form (css s