On Sat, Dec 27, 2008 at 10:07 PM, Martynas Brijunas <[email protected]> wrote:

> Why am I doing this? It is because I want to use it with the
> db.djangoforms.ModelForm class. If I have a list of choices for a
> field, the ModelForm automatically gives me a dropdown. If there is no
> list of choices all I get is a plain text entry field.

You probably want to use a ReferenceProperty to a Colour entity in
your Product model. Then, customise your form something like this:

class ProductEntryForm(djangoforms.ModelForm):
  class Meta:
    model = Product

  colour = djangoforms.ModelChoiceField(Colour, required=True,
    query=Colour.all().order('name'))

You can put any GqlQuery you want in the query=... bit.


Dave.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to