Re: how to create a hidden field

2011-08-02 Thread webcomm
On Aug 2, 4:56 pm, Brian Neal wrote: > Oh...you are trying to do this in the *admin*? Are you sure you just > don't need to "exclude" the form field? Yep, that's what I needed. I already had an admin class for the model, so it was just a matter of adding the line to exclude

Re: how to create a hidden field

2011-08-02 Thread Brian Neal
On Aug 2, 3:14 pm, webcomm wrote: > ... > Non-interactively, in the automatic admin, what I get is a visible > text input below the title field and above the summary field.  Here's > the relevant model and modelform:http://pastebin.com/azKgdraw > > -Ryan Oh...you are trying to

Re: how to create a hidden field

2011-08-02 Thread webcomm
> You still haven't shown that it doesn't hide the field, eg by posting > the output of frm.as_p(), where as I have shown conclusively that it > does, so I think something else is going on here. Are you sure the > field 'itemid' exists on your model? Thanks Tom. The field itemid does exist in

Re: how to create a hidden field

2011-08-02 Thread Tom Evans
On Tue, Aug 2, 2011 at 3:47 PM, webcomm wrote: >> Have you simplified your example? > > The example I provided in the original post is the actual code in my > models.py.  It's not simplified. > >> >>> class TestForm(ModelForm): >> >> ...   range = CharField(widget=HiddenInput)

Re: how to create a hidden field

2011-08-02 Thread webcomm
> Have you simplified your example? The example I provided in the original post is the actual code in my models.py. It's not simplified. > >>> class TestForm(ModelForm): > > ...   range = CharField(widget=HiddenInput) > ...   class Meta: > ...     model=Foo > ...>>> f=TestForm() > >>> f.as_p()

Re: how to create a hidden field

2011-08-02 Thread Tom Evans
On Tue, Aug 2, 2011 at 2:37 PM, webcomm wrote: >> That would hide the field called 'itemid' from the model 'News'. Are >> you saying it doesn't? > > That's right.  It's not working.  The field isn't hidden. > Have you simplified your example? This functionality works well when

Re: how to create a hidden field

2011-08-02 Thread webcomm
> That would hide the field called 'itemid' from the model 'News'. Are > you saying it doesn't? That's right. It's not working. The field isn't hidden. -Ryan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: how to create a hidden field

2011-07-26 Thread Tom Evans
On Tue, Jul 26, 2011 at 2:18 AM, webcomm <rya...@gmail.com> wrote: > I haven't been able to find anything documenting how to create a > hidden field.  I see this is done with the HiddenField widget but > don't know how to use that.  I tried the following but the field still >

how to create a hidden field

2011-07-25 Thread webcomm
I haven't been able to find anything documenting how to create a hidden field. I see this is done with the HiddenField widget but don't know how to use that. I tried the following but the field still shows... class NewsForm(ModelForm): itemid = forms.IntegerField(widget=forms.HiddenInput