Re: Problems with Django Form Processing

2012-02-06 Thread Jason
Your numerical values might be considered strings for that comparison. Try: if int(p) > 2: ... On Jan 16, 11:05 pm, zhyr28 wrote: > Hi all, I want to develop a survey app that has ten radio selects. > After people submit the survey, the data will be processing and then > output the result. I met

Problems with Django Form Processing

2012-01-27 Thread zhyr28
Hi all, I want to develop a survey app that has ten radio selects. After people submit the survey, the data will be processing and then output the result. I met a problem when I was trying to process the data from the form. Here is the code: forms.py: contains the survey questions. QUESTION_ONE= (

Re: forms and form processing

2011-07-01 Thread urukay
Hi Jay, take a look here, it is explained pretty well https://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#email-backend If don't have own SMTP server, you can try to use Google's SMTP server. Radovan http://www.yau.sk On 30. Jún, 21:06 h., "jay K." wrote: > Hello, > > thanks for t

Re: forms and form processing

2011-06-30 Thread jay K.
Hello, thanks for the reply I dont have email settings in my settings.py file? is that straightforward, like an import statement or something more complex? I am using django version (1, 1, 1, 'final', 0) - that's what i got after typing import django django.VERSION on the python shell Jay k On

Re: forms and form processing

2011-06-30 Thread urukay
Hi, have you got email settings set in your settings.py? What version of Django are you using? Radovan http://www.yau.sk On 29. Jún, 00:23 h., "jay K." wrote: > Hello, > > I need to add a form on my django website > > so far this is what i have: > > in my models.py: > > import statements no

forms and form processing

2011-06-28 Thread jay K.
Hello, I need to add a form on my django website so far this is what i have: in my models.py: import statements not shown here CONTACT_OPTIONS = ( ('skype video anruf','Skype Video- Anruf'), ('skype anruf ','Skype Anruf'),

Re: Class based views and form processing

2011-01-12 Thread Justin Murphy
Thanks, Skylar. You're right, it worked. Now I am just shaking my head and saying "next time, I'll just read the source..." -Justin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.

Re: Class based views and form processing

2011-01-12 Thread Skylar Saveland
what's wrong with just defining form_valid sth like: form_valid(self, form): self.object = form.save(commit=False) #ponies self.object.save() return HttpResponseRedirect(self.get_success_url()) does that not work? -- You received this message because you are subscribed to the

Re: Class based views and form processing

2011-01-12 Thread Skylar Saveland
instead of calling super, you could just call FormMixin.form_valid directly, yes? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Class based views and form processing

2011-01-12 Thread Justin Murphy
Hi, I still haven't found an answer to this problem so I am shamelessly bumping the last updated date. Thanks in advance for your help! -Justin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@

Re: Class based views and form processing

2011-01-10 Thread Justin Murphy
Thanks, Łukasz. I looked into overriding that method too, but it seems like there should be a cleaner way. I almost feel like the ``ModelFormMixin`` should have an API similar to a ``ModelAdmin`` where one could override a ``save_model()`` method on the subclass. The ``form_valid()`` method doe

Re: Class based views and form processing

2011-01-09 Thread Łukasz Rekucki
``CreateView`` includes ``ModelFormMixin``, which is responsible for saving the model form: def form_valid(self, form): self.object = form.save() return super(ModelFormMixin, self).form_valid(form) So, you need to override that method in your subclass: class ListCreateView(Cr

Class based views and form processing

2011-01-09 Thread Justin
Hello, I am experimenting with the new class based views coming in 1.3 and am having trouble figuring out when/where to put this code. I want to populate a model's created_by field with the user of the current request. In the old views, I would have done something this: obj = form.save(commit=Fal

Re: Form processing using bash script

2009-10-06 Thread Carlos Gustavo
Brilliant! Just what I needed to hear. :-) Thanks, Kevin. -Carlos. On Tue, Oct 6, 2009 at 3:56 PM, Kevin Teague wrote: > > > > On Oct 6, 12:02 pm, Carlos Gustavo wrote: > > Thanks Kevin, > > > > I would give it a shot. Doesn't sound as easy as I had hoped. :-) > > > > To make things even hard

Re: Form processing using bash script

2009-10-06 Thread Kevin Teague
On Oct 6, 12:02 pm, Carlos Gustavo wrote: > Thanks Kevin, > > I would give it a shot. Doesn't sound as easy as I had hoped. :-) > To make things even harder, keep in mind that any data gotten from the HTTP request which is passed on to a shell call as an argument must first be checked and/or c

Re: Form processing using bash script

2009-10-06 Thread Carlos Gustavo
Thanks Kevin, I would give it a shot. Doesn't sound as easy as I had hoped. :-) -Carlos. On Tue, Oct 6, 2009 at 2:55 PM, Kevin Teague wrote: > > Use the os.subprocess module in the python standard library to invoke > the bash script from your django view code: > > http://docs.python.org/librar

Re: Form processing using bash script

2009-10-06 Thread Kevin Teague
Use the os.subprocess module in the python standard library to invoke the bash script from your django view code: http://docs.python.org/library/subprocess.html Although in my experience, when there is a bash script wrapping a number of calls to other programs, I tend to find it easier to work w

Re: Form processing using bash script

2009-10-06 Thread Carlos Gustavo
Hi Daniel, Thanks for the response to my mail. These input values are used by a bash script containing various C programs and the processing results in graph that needs to be displayed as an image plot on the response form. Thanks again. -Carlos On Tue, Oct 6, 2009 at 2:01 PM, Daniel Roseman w

Re: Form processing using bash script

2009-10-06 Thread Daniel Roseman
On Oct 6, 6:01 pm, Carlos Gustavo wrote: > Hi Everyone, > > I am Django newbie and the experience has been exciting. > > I want some help with the ff. challenge I am now facing: > > How can I get a Django form to process a bash script executing a bunch of C > programs running on linux. > > Any po

Form processing using bash script

2009-10-06 Thread Carlos Gustavo
Hi Everyone, I am Django newbie and the experience has been exciting. I want some help with the ff. challenge I am now facing: How can I get a Django form to process a bash script executing a bunch of C programs running on linux. Any pointers or suggestions would be deeply appreciated. Thanks

Re: Test client and form processing

2009-08-25 Thread Joshua Russo
Ya, when I'm writing unit tests for my forms. What I wanted was a way in my testing logic to generate a dictionary of values to post back to the server based on the initial values of the forms in the content property of the response object returned from the test client get() and/or post() methods.

Re: Test client and form processing

2009-08-25 Thread Peter Bengtsson
Do you mean when you write tests? If so, when you get the response you can extract all the variables that was created inside the view if you're using locals(). That way, you can probably get the form instance (created for example by form=MyForm(request.POST)) which you can then untangle to get all

Test client and form processing

2009-08-25 Thread Joshua Russo
I'm working on putting together parsing logic so that I can extract the form variables from the response content of the test Client. That way I can just change a few values and throw it back at the server. This is especially helpful with large dynamic forms that use formsets. My question is, has th

Re: Django admin panel how add extra function in form processing?

2009-08-04 Thread Asinox
Sorry krylatij, im new with django, i will try :) thanks On 4 ago, 11:22, krylatij wrote: > Why do you need admin here? > You can generate it in the save() method of your model. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Django admin panel how add extra function in form processing?

2009-08-04 Thread krylatij
Why do you need admin here? You can generate it in the save() method of your model. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups

Django admin panel how add extra function in form processing?

2009-08-04 Thread Asinox
Hi guys, somebody know how ill use a extra function in any form processing in the Django admin?, the problem is that i need to generate a encrypted code in the moment that a form is sendinga and save the code in the database in the user's account panel i did it... but i dont know how ill

Re: Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Karthik Krishnan
Hi Daniel, Thanks for your solution. It worked. Thanks, Karthik On Sep 18, 1:46 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Sep 18, 9:34 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have a form which contains some prefilled data and some to be filled > > in by the u

Re: Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:34 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > Hi, > > I have a form which contains some prefilled data and some to be filled > in by the user. I have no trouble getting the forms to be prefilled. > What I want is thatfor a GET request, if the form data pre exists, > then displa

Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Karthik Krishnan
Hi, I have a form which contains some prefilled data and some to be filled in by the user. I have no trouble getting the forms to be prefilled. What I want is thatfor a GET request, if the form data pre exists, then display it; if not, then show a blank text field . For a post request, if the fie

Re: Form Processing

2008-04-18 Thread [EMAIL PROTECTED]
, > > > This is vamsi . I am new  to Django. > > Hello! > > How  we  can do form processing in django.? > > > I need in  startup screen  to activate buttons depending on data > > stored in  model. > > I'm not sure exactly what you mean by this. Can you

Re: Form Processing

2008-04-17 Thread Jeff Anderson
gvkreddy wrote: HI, This is vamsi . I am new to Django. Hello! How we can do form processing in django.? I need in startup screen to activate buttons depending on data stored in model. I'm not sure exactly what you mean by this. Can you be more specific? Django can output

Re: Form Processing

2008-04-17 Thread rajiv bammi
Hi.. Please go through following link.. http://www.djangobook.com/en/1.0/chapter07/ feel free if u have any problem ;) Thanks Rajiv Bammi On Fri, Apr 18, 2008 at 11:07 AM, gvkreddy <[EMAIL PROTECTED]> wrote: > > HI, > > This is vamsi . I am new to Django. > > How we

Form Processing

2008-04-17 Thread gvkreddy
HI, This is vamsi . I am new to Django. How we can do form processing in django.? I need in startup screen to activate buttons depending on data stored in model. How we can done this in django? Any help. Thanks in advance. by vamsi

Re: Testing Search form processing

2008-04-07 Thread Tony
Ah I know where I have gone wrong now. I should have specified q instead of query in my test function. Its so obvious now. I think I spent too long looking at test function, it made my eyes blurry. Thanks Tony On Apr 7, 10:47 am, Tony <[EMAIL PROTECTED]> wrote: > I have developed an application

Testing Search form processing

2008-04-07 Thread Tony
I have developed an application using the search form from chapter 7 of the Django Book, http://www.djangobook.com/en/1.0/chapter07/. I am having trouble testing the search view, it seems like (from my view below) it is not returning 'q', but rather, returning nothing. It might be the way I have

Re: Chapter 7: Form Processing

2008-02-24 Thread Malcolm Tredinnick
On Sun, 2008-02-24 at 21:35 -0800, nwgadgetguy wrote: [...] > If the second example is followed, then the HTML code would be under > mysite\books\templates, > NOT mysite\books\templates\books, which makes it a confusing fix (why > have another DIR [books] > under templates when templates is alrea

Re: Chapter 7: Form Processing

2008-02-24 Thread nwgadgetguy
> On Jan 16, 5:42 pm, Mikey3D <[EMAIL PROTECTED]> wrote: > > Hi Rajesh, > The book chapter 7 doesn't say new sub-dir called books in your > application's templates directory. For the beginners who are reading > the Django book will get confusing. >On Jan 16, 3:27 pm, Rajesh Dhawan <[EMAIL PROTECT

Re: Chapter 7: Form Processing

2008-01-16 Thread Rajesh Dhawan
On Jan 16, 5:42 pm, Mikey3D <[EMAIL PROTECTED]> wrote: > Hi Rajesh, > > The book chapter 7 doesn't say new sub-dir called books in your > application's templates directory. For the beginners who are reading > the Django book will get confusing. You might want to add a comment to an appropriate

Re: Chapter 7: Form Processing

2008-01-16 Thread Mikey3D
Hi Rajesh, The book chapter 7 doesn't say new sub-dir called books in your application's templates directory. For the beginners who are reading the Django book will get confusing. http://www.djangobook.com/en/1.0/chapter07/ Thank for the loading templates link, I have done chapter 4 with no pro

Re: Chapter 7: Form Processing

2008-01-16 Thread Rajesh Dhawan
Hi again, > > Rajesh Dhawan, I have just add comma, it works. Thanks Rajesh but I > get an error: > > - > Exception Type: TemplateDoesNotExist at /search/ > Exception Value: books/search.html > ---

Re: Chapter 7: Form Processing

2008-01-16 Thread Mikey3D
FrankW, I have tried remove the quotes but it didn't work. Rajesh Dhawan, I have just add comma, it works. Thanks Rajesh but I get an error: - Exception Type: TemplateDoesNotExist at /search/ Exception Value: books/search.html -

Re: Chapter 7: Form Processing

2008-01-16 Thread Rajesh Dhawan
Hi, > urlpatterns = patterns('', >     (r'^time/$', current_datetime), >     (r'^time/plus/(\d{1,2})/$', hours_ahead), >     (r'^search/$', 'mysite.books.views.search') You are missing a comma at the end of the above line -Rajesh D --~--~-~--~~~---~--~~ You rece

Re: Chapter 7: Form Processing

2008-01-16 Thread FrankW
remove the quotes around mysite.books.views.search in: (r'^search/$', 'mysite.books.views.search') On Jan 16, 2:58 pm, Mikey3D <[EMAIL PROTECTED]> wrote: > I have an error: > > Exception Type: ImproperlyConfigured at /search/ > Exception Value: Error while importing URLconf 'mysite.urls': 'tuple

Chapter 7: Form Processing

2008-01-16 Thread Mikey3D
I have an error: Exception Type: ImproperlyConfigured at /search/ Exception Value: Error while importing URLconf 'mysite.urls': 'tuple' object is not callable Here're the files: Module: mysite.books.views --- from django.db.models import Q from django.shortc

Re: newforms form processing

2007-08-31 Thread Tim Chase
> How can i best program a view that both adds and updates certain > values in a table. I know that django can tell the difference when you > want to update and when to insert. I tried using the > Classname.objects.create(args)...but this doesn't seem to work...it > just inserts instead of updatin

newforms form processing

2007-08-31 Thread Rufman
How can i best program a view that both adds and updates certain values in a table. I know that django can tell the difference when you want to update and when to insert. I tried using the Classname.objects.create(args)...but this doesn't seem to work...it just inserts instead of updating a record

Re: form processing

2007-07-13 Thread Mackenzie
Thanks for your help I was not understanding why I could not get both values. On Jul 13, 3:10 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > > I have a form on one of my pages that has two fields with the same > > name. When I process the POST in my view I only get one of the values > > (

Re: form processing

2007-07-13 Thread Jonathan Buchanan
> I have a form on one of my pages that has two fields with the same > name. When I process the POST in my view I only get one of the values > ( the last one ). > > EXAMPLE: > HTML > > > > DEBUG > POST: > > VIEW > request.POST['version'] > > the above line is = 35 if both checkboxes are checked

Re: form processing

2007-07-13 Thread [EMAIL PROTECTED]
The second value is overwriting the first. I don't think you can return a list unless you use a multi-select box. On Jul 13, 2:45 pm, Mackenzie <[EMAIL PROTECTED]> wrote: > I have a form on one of my pages that has two fields with the same > name. When I process the POST in my view I only get on

form processing

2007-07-13 Thread Mackenzie
I have a form on one of my pages that has two fields with the same name. When I process the POST in my view I only get one of the values ( the last one ). EXAMPLE: HTML DEBUG POST: VIEW request.POST['version'] the above line is = 35 if both checkboxes are checked any ideas why I don't get a