Thank you TiNo that works if altered slightly like so:
if form.is_valid():
instance = form.save(commit=False)
instance.street_id= request.session['street_id']
instance.save()
I have been using Django for about ten days, and it requires very
d
On Fri, Jun 5, 2009 at 11:04, adelaide_mike wrote:
> Exception Value: 'PropertyForm' object does not support item
> assignment
>
There you go. You can't do:
> form['street']=request.session['street_id']
You can save the form instance first, without commiting, then set the street
the instance
Thanks for the offer. I have altered the function as suggested:
def property_data(request, property_id='0'):
message = ''
st = request.session['street_id']
print "At start of property_data, request.method=", request.method
print "At start of property_data, st=", s
On Jun 5, 5:33 am, adelaide_mike wrote:
> Another "in principle" question. My Street model is the parent of my
> Property model, many to one via foreign key.
>
> User selects the street and I store it in request.session. User then
> gets to enter the property details in this form:
>
> class Prop
4 matches
Mail list logo