[google-appengine] Pass initial parameters to form

2008-09-26 Thread Tiranox

Hello  All!
I try pass initial parameters to form, with choise.
But it's not work.

class PhoneNumber(db.Model):
number = db.StringProperty()
phone_type = db.StringProperty(
choices=('work', 'cell'))

class PhoneNumberForm(djangoforms.ModelForm):
class Meta:
model = PhoneNumber

def newp(request):
user = users.GetCurrentUser()
form = PhoneNumberForm(initial={'phone_type':(('1','w'),
('2','r'))})
return respond(request, user, 'addst', {'form': form})

Why choise list 'w', 'r' are ignored?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to pass additionap parameters to Form

2008-09-26 Thread Tiranox

can i pass any parameters with initial value ?
form = PhoneNumberForm(initial={'number':'12334'})
how i can access to initial var ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] How to pass additionap parameters to Form

2008-09-25 Thread Tiranox

How to pass additionap parameters to Form
For example:

class PhoneNumber(db.Model):
number = db.StringProperty()
phone_type = db.StringProperty(
choices=('work', 'cell'))

class PhoneNumberForm(djangoforms.ModelForm):
 v
class Meta:
model = PhoneNumber

def newp(request):

user = users.GetCurrentUser()
form = PhoneNumberForm(v='text')
return respond(request, user, 'addst', {'form': form})

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---