Please ignore [Was: Hidden fields]

2018-07-24 Thread Mike Dewhirst
Sorry to bother you. Just discovered the HiddenInput widget. M On 24/07/2018 5:40 PM, Mike Dewhirst wrote: show_hidden_initial is an undocumented API feature. It defaults to False. Is the correct way to specify a field as hidden in Django to make that attribute True in the form? Thanks Mik

Hidden fields

2018-07-24 Thread Mike Dewhirst
show_hidden_initial is an undocumented API feature. It defaults to False. Is the correct way to specify a field as hidden in Django to make that attribute True in the form? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

Re: How to prevent the use of hidden fields in a form

2017-08-17 Thread Jani Tiainen
Hi. Of course you don't use hidden field value at all from the form (you shouldn't even have those values there in the first place). Get and set id and date after you have validated form otherwise to final object so there isn't any possibility to even try to change to value On 17.8.2017 16

How to prevent the use of hidden fields in a form

2017-08-17 Thread Thiago Luiz Parolin
I have a system that does: 1 - The user registers a project with name, title and responsible teacher 2 - The teacher responsible for this project must authorize it or not So I have a page that displays to the teacher, all the projects that are waiting for authorization and in each project there is

Re: Hidden fields in formsets

2015-03-31 Thread aRkadeFR
nt to set some *hidden* fields in it : user_create, date_create on creation, user_update, date_update on update. I've created a MultiFormsetMixin, which provide machinery to initialize those formsets in my CreateView / UpdateView. Basicaly, the mixin fill a formset_list containing dicts with

Hidden fields in formsets

2015-03-31 Thread François GUÉRIN
Hi, I'm using multiple formsets in Create / Update views, and I want to set some *hidden* fields in it : user_create, date_create on creation, user_update, date_update on update. I've created a MultiFormsetMixin, which provide machinery to initialize those formsets in my

Re: Django Generic Create VIew and Hidden fields

2014-09-28 Thread Tom Evans
On Sun, Sep 28, 2014 at 5:49 PM, Sabine Maennel wrote: > Can someone please help me with Create View? I have a hidden field and not > having it in the form causes Django to not store my object in the database. > It fails silently. > > So here are my files: > > model.py: > class Application(TimeSta

Django Generic Create VIew and Hidden fields

2014-09-28 Thread Sabine Maennel
Can someone please help me with Create View? I have a hidden field and not having it in the form causes Django to not store my object in the database. It fails silently. So here are my files: *model.py:* class Application(TimeStampedModel): name = models.CharField(max_length=50) applic

Re: forms, hidden fields

2011-01-20 Thread niall-oc
Bang on the head :-) Cheers for that On Jan 18, 5:55 pm, Brian Neal wrote: > On Jan 18, 8:32 am, niall-oc wrote: > > > ... > > There is a simple form.  My question is how do you set a field to be > > hidden. > > >http://docs.djangoproject.com/en/1.1/topics/forms/#looping-over-the-f... > > > Thi

Re: forms, hidden fields

2011-01-18 Thread Brian Neal
On Jan 18, 8:32 am, niall-oc wrote: > ... > There is a simple form.  My question is how do you set a field to be > hidden. > > http://docs.djangoproject.com/en/1.1/topics/forms/#looping-over-the-f... > > This document explains how you may check if a field is hidden, however > there seems to be no

forms, hidden fields

2011-01-18 Thread niall-oc
class VerificationForm(forms.Form): domain = forms.CharField(max_length=100, label='Domain name', help_text='This is the domain name you chose during the signup process', ) mobile_number = forms.CharField(max_length=10,

Re: hidden fields not cleaned

2010-03-23 Thread gentlestone
gt; > > >         cleaned_data = self.cleaned_data > > > >         #cleaned_data.get(key) returns None if key does not exist > > > >         some_hidden_field = cleaned_data.get("some_hidden_field") > > > > >         if some_hidden_field: > &g

Re: hidden fields not cleaned

2010-03-23 Thread gentlestone
hidden_field: > > >             #do your custom validation here and raise ValidationError > > > if necessary > > >         # Always return the full collection of cleaned data. > > >         return cleaned_data > > > > On Mar 22, 3:31 pm, gentleston

Re: hidden fields not cleaned

2010-03-23 Thread Bjunix
; > this piece of code leads to Key error 'some_hidden_field' > > > > class XyForm(Form): > > > >     some_hidden_field = > > > forms.DateTimeField(widget=forms.HiddenInput()) > > > >     def clean(self): > > >         some_hidden

Re: hidden fields not cleaned

2010-03-23 Thread gentlestone
> > > this piece of code leads to Key error 'some_hidden_field' > > > class XyForm(Form): > > >     some_hidden_field = > > forms.DateTimeField(widget=forms.HiddenInput()) > > >     def clean(self): > >         some_hidden_field = self.c

Re: hidden fields not cleaned

2010-03-22 Thread Bjunix
imeField(widget=forms.HiddenInput()) > >     def clean(self): >         some_hidden_field = self.cleaned_data['some_hidden_field'] > > Why are hidden fields not cleaned? > I need to validate the hidden value and raise VadiationError if the > value is not ok. -- You

hidden fields not cleaned

2010-03-22 Thread gentlestone
this piece of code leads to Key error 'some_hidden_field' class XyForm(Form): some_hidden_field = forms.DateTimeField(widget=forms.HiddenInput()) def clean(self): some_hidden_field = self.cleaned_data['some_hidden_field'] Why are hidden fields not cleaned

Re: ModelForm, foreignkey, and hidden fields is null

2009-06-17 Thread Rochak Neupane
just tried it out. worked perfectly. thanks! On Tue, Jun 16, 2009 at 3:18 PM, Rochak Neupane wrote: > ohh, thanks, Daniel! I like your way. and i don't even my to expose the > user_id in a form.I'll try that. > > > On Mon, Jun 15, 2009 at 10:55 PM, Daniel Roseman wrote: > >> >> On Jun 16, 1:12 a

Re: ModelForm, foreignkey, and hidden fields is null

2009-06-16 Thread Rochak Neupane
ohh, thanks, Daniel! I like your way. and i don't even my to expose the user_id in a form.I'll try that. On Mon, Jun 15, 2009 at 10:55 PM, Daniel Roseman wrote: > > On Jun 16, 1:12 am, k-dj wrote: > > I'm just starting to use django and have run into a problem I have not > > been able to solve.

Re: ModelForm, foreignkey, and hidden fields is null

2009-06-15 Thread Daniel Roseman
On Jun 16, 1:12 am, k-dj wrote: > I'm just starting to use django and have run into a problem I have not > been able to solve. > > I have a model Item which stores, among other things, user_id. > Then I have a ModelForm. I want user_id to be a hidden field. After > searching around the web, I fou

ModelForm, foreignkey, and hidden fields is null

2009-06-15 Thread k-dj
I'm just starting to use django and have run into a problem I have not been able to solve. I have a model Item which stores, among other things, user_id. Then I have a ModelForm. I want user_id to be a hidden field. After searching around the web, I found out how to create a hidden field. The tem

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Jason Sidabras
views, but when the user is logged in data comes from > > the template so just "post" won't do. I would need to simulate > > clicking the submit button. > > > Twill seems to do this similar to Perl's mechanize module. I am > > familiar with this 'find

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Malcolm Tredinnick
; Twill seems to do this similar to Perl's mechanize module. I am > familiar with this 'find forum' submit type of coding but I was > wondering if django has a way to grab these hidden fields and place > them in the post data when i run a > > c = Client() > c.post(&#x

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Jason Sidabras
= 1 which is > > easy to test by: > > > from django.test.client import Client > > > c = Client() > > c.post('sender_id': '1', 'post', '') > > > but when setting up unit tests for the form when a user is logged in, >

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Malcolm Tredinnick
to test by: > > from django.test.client import Client > > c = Client() > c.post('sender_id': '1', 'post', '') > > but when setting up unit tests for the form when a user is logged in, > I am not clear on how to use the hidden fields.

Unit Testing forms with hidden fields

2008-12-08 Thread Jason Sidabras
'1', 'post', '') but when setting up unit tests for the form when a user is logged in, I am not clear on how to use the hidden fields. the example would be using the: c.login(username = 'user', password = 'secret') I found a snippet of code using Twill

Re: hidden fields in forms

2008-11-26 Thread ChrisK
> form = newFenceForm(initial={'auth_id' : auth_id}) Awesome. That was exactly what I needed - thanks very much. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: hidden fields in forms

2008-11-25 Thread Malcolm Tredinnick
On Tue, 2008-11-25 at 18:03 -0800, ChrisK wrote: > OK, thanks for your suggestions (and yes, I meant "POST"). > > The problem now appears to be how I initialize the form's value of > auth_id! Oh, right. I missed that error initially. Yes, you're doing it incorrectly. The first positional argum

Re: hidden fields in forms

2008-11-25 Thread ChrisK
OK, thanks for your suggestions (and yes, I meant "POST"). The problem now appears to be how I initialize the form's value of auth_id! If I use just {{form.as_p}} in my template, I get the following html: (Hidden field auth_id) This field is required. This field is required. Teaser: This fiel

Re: hidden fields in forms

2008-11-25 Thread Malcolm Tredinnick
On Tue, 2008-11-25 at 15:06 -0800, ChrisK wrote: > I'm just not getting this. I've looked at many examples and can't seem > to pass a hidden value into a form. > > The problem is that I initially get to the form with GET, and then > instantiate the form with PUT. The key that I need is part of t

Re: hidden fields in forms

2008-11-25 Thread Brian Neal
On Nov 25, 6:24 pm, ChrisK <[EMAIL PROTECTED]> wrote: > > Well..you aren't passing auth_id to the template, you are passing > > form. auth_id is a field inside your template. Can you post your > > template? > > Oh, sorry - my oversight. Template is > > > id="id_auth_id" /> > Reminder String: >  

Re: hidden fields in forms

2008-11-25 Thread ChrisK
> Well..you aren't passing auth_id to the template, you are passing > form. auth_id is a field inside your template. Can you post your > template? Oh, sorry - my oversight. Template is Reminder String: URL of document: Address of interest: Range (in meters): I guess I'm

Re: hidden fields in forms

2008-11-25 Thread Brian Neal
On Nov 25, 5:06 pm, ChrisK <[EMAIL PROTECTED]> wrote: > I'm just not getting this. I've looked at many examples and can't seem > to pass a hidden value into a form. > > The problem is that I initially get to the form with GET, and then > instantiate the form with PUT. The key that I need is part o

hidden fields in forms

2008-11-25 Thread ChrisK
I'm just not getting this. I've looked at many examples and can't seem to pass a hidden value into a form. The problem is that I initially get to the form with GET, and then instantiate the form with PUT. The key that I need is part of the original URL, and I'm trying to push it down into the PUT

newforms generic and hidden fields in form

2008-07-25 Thread hotani
I had a form that was working with oldforms generic and had some hidden fields. After the newforms-admin merge and newforms-generic, the hidden fields are being passed as NULL. In 'BackwardsIncompatibleChanges,' it says "You'll probably need to update any templates used by th

Re: hidden fields

2007-10-02 Thread [EMAIL PROTECTED]
I had a similar situation with hidden fields. I was using a newform, but didn't include the hidden fields. Then, in my template I had something like: {{ form }} where id_email had been set earlier in the view. This worked for me. On Oct 2, 7:27 am, Ana <[EMAIL PROTECTED

Re: hidden fields

2007-10-02 Thread Ana
Thanks RajeshD :) It wasn't exactly what I wanted to do but it was helpful. On Sep 7, 4:45 pm, RajeshD <[EMAIL PROTECTED]> wrote: > On Sep 7, 9:55 am, Ana <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'd like to have "last modified by" and "owner" fields in my > > application. I'd like to set fields

Re: hidden fields

2007-09-07 Thread RajeshD
On Sep 7, 9:55 am, Ana <[EMAIL PROTECTED]> wrote: > Hi, > I'd like to have "last modified by" and "owner" fields in my > application. I'd like to set fields value automatically, and I want > those fields to be hidden. Is there any way I can do that? Yes. Here's one way to do it: Add those t

hidden fields

2007-09-07 Thread Ana
Hi, I'd like to have "last modified by" and "owner" fields in my application. I'd like to set fields value automatically, and I want those fields to be hidden. Is there any way I can do that? Thanks in advance, Ana --~--~-~--~~~---~--~~ You received this message

Re: Newforms and Hidden Fields - verifying POST data

2007-04-27 Thread Tipan
Having implemented this solution, I'm now getting problems with comparison differences between the hash that I pass in the form as a hidden field and the hash of the data taken from the Form view. If I look at the data before and after, it appears that the data from the form object is using carri

Re: Newforms and Hidden Fields - verifying POST data

2007-04-24 Thread Tipan
Simon, thanks for this post, it is beautifuly succint and comprehensive and is exactly what I was after. It has also enabled me to clean up my code, if I pickle all the date, I don't need to create a dynamic field form object, 2 fields are all that are required (as SmileyChris pointed out). A muc

Re: Newforms and Hidden Fields - verifying POST data

2007-04-23 Thread queezy
t; Sent: Monday, April 23, 2007 7:57 PM Subject: Re: Newforms and Hidden Fields - verifying POST data > > On Apr 23, 5:04 pm, Tipan <[EMAIL PROTECTED]> wrote: >> I'm seeking advice on how to ensure my form data in hidden fields is >> the same after the user has p

Re: Newforms and Hidden Fields - verifying POST data

2007-04-23 Thread Simon Willison
On Apr 23, 5:04 pm, Tipan <[EMAIL PROTECTED]> wrote: > I'm seeking advice on how to ensure my form data in hidden fields is > the same after the user has posted the form. Sign it. The easiest way to do this would be something like this: 1. Throw all of the data you want to pe

Re: Newforms and Hidden Fields - verifying POST data

2007-04-23 Thread SmileyChris
On Apr 24, 4:04 am, Tipan <[EMAIL PROTECTED]> wrote: > I'm seeking advice on how to ensure my form data in hidden fields is > the same after the user has posted the form. If it's calculated data (somehow) then why do you need to pass it to the user? Couldn't you just

Newforms and Hidden Fields - verifying POST data

2007-04-23 Thread Tipan
I'm seeking advice on how to ensure my form data in hidden fields is the same after the user has posted the form. I've got a form instance containing my data and rendered this to html with the data in hidden fields. My Post then takes this data and stores it to a database. I'