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
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= (
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
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
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
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'),
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.
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
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
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...@
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
``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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
,
>
> > 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
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
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
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
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
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
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
> 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
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
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
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
> ---
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
-
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
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
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
> 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
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
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
> > (
> 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
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
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
50 matches
Mail list logo