Hello! I have a MyForm which have name, quantity and quandesc fields.
I have a basic UI form for adding this fileld.
I added button for adding another instances of field on web page. Jquery
func below:
function addContainer() {
$("#name").clone().appendTo("#food-container");
$("#quantit
class FoodForm(ModelForm):
class Meta:
model = Foods
fields = '__all__'
widgets = {
'quantity': NumberInput(attrs={'min': 1}),
'comment': TextInput(),
}
пятница, 1 апреля 2016 г., 11:47:33 UTC+3 пользователь Denis Makaro
x27;, 'Qty'),
('Kilo', 'Kg.'), ('Litr', 'L.')), default='Item')
comment = models.TextField(blank=True)
to_ods = models.BooleanField(default=False)
to_email = models.BooleanField(default=False)
foodlist = models.ManyToManyField('
Hello!
I have my own ModelForm with widgets in Meta class.
class Meta:
model = Foods
fields = '__all__'
widgets = {
'quantity': NumberInput(attrs={'min': 1, 'max': 10, 'name': "quantity2"}),
'comment': TextInput(),
}
My quantity field have NumberInput as standard.
I want to re
I read this, but in tutorial not used forms.Form class. I know how created
forms on models.Model and forms.Form. But when I must use first and when
second?
суббота, 12 марта 2016 г., 0:56:34 UTC+3 пользователь James Schneider
написал:
>
> On Mar 10, 2016 9:01 PM, "Denis Maka
You mean, that I must use Models.Model for database and Forms for creating
forms both?
пятница, 11 марта 2016 г., 7:06:01 UTC+3 пользователь bob gailer написал:
>
>
> On Mar 10, 2016 9:01 PM, "Denis Makarov" > wrote:
> >
> > Hello guys! In whitch cases need
Hello guys! In whitch cases need to use models.Model class and in whitch
forms.Form?
Don't understand it readed the documentation.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from
7 matches
Mail list logo