Google Groups Home
Help | Sign in
google app engine i django forms
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
koval  
View profile
 More options May 1, 6:20 am
Newsgroups: pl.comp.lang.python
From: koval <ko...@USUNTOkonto.pl>
Date: Thu, 01 May 2008 12:20:10 +0200
Local: Thurs, May 1 2008 6:20 am
Subject: google app engine i django forms
Bawi� si� GAE i natkn��em si� na ma�y problem - mam przyk�adowo taki model:

class Kategoria(db.Model):
     name = db.StringProperty('Nazwa',required=True)

i tworz� taki obiekt Form:

class AddKategoriaForm(djangoforms.ModelForm):
     class Meta:
         model = Kategoria

wszystko �adnie, pi�knie, ale jak doda� atrybuty do tworzonych kontrolek
input (jak size/maxlegth/class ...) ?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tomasz Elendt  
View profile
 More options May 2, 3:05 pm
Newsgroups: pl.comp.lang.python
From: Tomasz Elendt <nie...@maila.pl>
Date: Fri, 02 May 2008 21:05:19 +0200
Local: Fri, May 2 2008 3:05 pm
Subject: Re: google app engine i django forms
koval pisze:

> Bawię się GAE i natknąłem się na mały problem - mam przykładowo taki model:

> class Kategoria(db.Model):
>     name = db.StringProperty('Nazwa',required=True)

> i tworzę taki obiekt Form:

> class AddKategoriaForm(djangoforms.ModelForm):
>     class Meta:
>         model = Kategoria

O! Nie wiedziałem, że djangowy ModelForm "gada" z modelami GAE.

> wszystko ładnie, pięknie, ale jak dodać atrybuty do tworzonych kontrolek
> input (jak size/maxlegth/class ...) ?

http://www.djangoproject.com/documentation/modelforms/#overriding-the...
http://www.djangoproject.com/documentation/newforms/#customizing-widg...
?

--
Eluś


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
koval  
View profile
 More options May 3, 8:58 am
Newsgroups: pl.comp.lang.python
From: koval <ko...@USUNTOkonto.pl>
Date: Sat, 03 May 2008 14:58:25 +0200
Local: Sat, May 3 2008 8:58 am
Subject: Re: google app engine i django forms
Tomasz Elendt pisze:

Dziekuje za naprowadzenie :)
Rzeczywiscie, po wczesniejszym zaimportowaniu newforms (from django
import newforms as forms) , wystarczy zrobic tak:

class AddKategoriaForm(djangoforms.ModelForm):
     name = forms.CharField(label = 'Nazwa', widget =
forms.TextInput(attrs = {'size':'40'}))
     class Meta:
         model = Kategoria

daje to tez mozliwosc wprowadzenia do formy pol, jakich nie ma w modelu.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google