uot;C:\Documents and Settings\hversemann\djangoprojects\mysite
\polls\models.
py", line 7, in Poll
pub_date = models.DateFimeField('date published')
AttributeError: 'module' object has no attribute 'DateFimeField'
I'm not sure what more I can do or where else
I have pretty much completed the intro. tutorial for django. I'm now
trying to add some actual updating screens to the existing site, to
experiment and also to try to figure out more how everything works.
I'm currently trying to code an "addpoll" screen which I've coded to
look like this:
Add Poll
Is data entered on an input screen automatically added to the request
when the screen is submitted? If so are there any special parameters
or settings in the screen controls which have to be set/coded to get
the entered data saved into the request and under what keys is the
data saved? Once in the
I've been going through a lot of the forms related documentation and
some things are still not clear, partly because of information
overload. First do I have to code/generate my forms using my models?
If not then if I code my form from scratch will it still have all or
most of the background functi
Is it possible to use javascript to capture and react to events and
possibly enable/disable screen controls by setting values or flags?
How do I access the values or selected option(s) of say a checkbox
control, dropdown box so that I can react to them in my views? Is it
possible to react to contro
I've seen how to build my own forms in the documentation and how to
import the Django base forms class, but where does the code to build
my own screens get put? Is it supposed to be put in the views module
for my app or somewhere else? I'm guessing it goes in the views, but
that's only my best gues
Can someone explain to me what the following error is trying to tell
me:
SyntaxError at /polls/1
invalid syntax (urls.py, line 20)Request Method: GET
Request URL: http://127.0.0.1:8000/polls/1
Django Version: 1.2.3
Exception Type: SyntaxError
Exception Value: invalid syntax (urls.py, line 20)
Exce
ey should be. I thought I had previously fixed all of
them, but maybe I missed something. Please advise. Thanks.
On Jan 4, 9:36 am, Piotr Zalewa wrote:
> what happens if you'remove the commented lines?
>
> On 01/04/11 15:22, hank23 wrote:
>
>
>
>
>
> >
one problem in my views.py file. Thanks for
the suggestion. It did helpme find the problem(s).
hank23
On Jan 4, 11:16 am, cewing wrote:
> Is it possible that the problem is not in this urls.py, but rather in
> 'polls.urls'?
>
> I'd check line 20 there, just to see i
I'm in the process of coding a new screen which I want to use a form
on. I'm also currently coding the new form to go with it. The screen
will have a dropdown box, a conditional textbox, and a submit button,
as well as some other informational fields and a title on it. Since
this is my first explic
I'm not understanding what the error "TemplateSyntaxError at /admin/"
is trying to tell me. The full text of the error message looks like
this:
TemplateSyntaxError at /admin/
Caught ViewDoesNotExist while rendering: Tried addchoice in module
polls.views. Error was: 'module' object has no attribute
Near the top of my views.py I do have "from django import forms", so
I'm guessing that based on previous comments that this is ok. Do I
also need to import my specific named-form which IO created for the
new screen/view from my polls.forms.py module? If so is this syntax
correct:
from polls.forms
OK here's the entire views.py code:
# Create your views here.
from django.http import Http404
from django.shortcuts import render_to_response, get_object_or_404,
get_list_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.t
l in polls %}
{{ poll.question }}
{% endfor %}
{% if newchoice %}
NEW CHOICE ADDED WAS={{ newchoice }}
{% endif %}
Thanks for the help.
On Jan 5, 11:41 am, hank23 wrote:
> OK here's the entire views.py code:
>
> # Create your views here.
>
> from django.http import Http404
Besides the mostly general documentation documents found on the django
website or referenced in other documents on the site is there anywhere
else to go to get good complete coding examples of using forms in
views showing form and form field creation, associated view code, and
also the correspondin
I'm trying to display DB data in a dropdon box on a screen using a
form. Here's my form/formfield code:
from django import forms
class AddChoiceForm(forms.Form):
ccount = forms.IntegerField()
pquestion = forms.CharField()
message = forms.CharField()
polls = forms.ChoiceField(requi
Actually I have been through the tutorial, but there are still a lot
of gaps in the information presented, because many of the examples may
or may not show all of the code in all of the various modules which is
needed for everything to work together successfully. My next question
is what is wrong w
In the topics forms documentation there's an example of using a form
in a view which shows a return statement using a render_to_respone
shortcut like this:
return render_to_response('contact.html', {
'form': form,
})
but in the shortcuts documentation it shows an example of using
render_to_r
seman wrote:
> On Friday, January 7, 2011 3:15:33 PM UTC, hank23 wrote:
>
> > In the topics forms documentation there's an example of using a form
> > in a view which shows a return statement using a render_to_respone
> > shortcut like this:
>
> > re
uary 7, 2011 3:38:10 PM UTC, hank23 wrote:
>
> > So then when using a form do I code it something like this then:
>
> > return render_to_response('contact.html', {
> > 'form': form,
> > my_data_dictionary,
> > context_instance=Req
Another question about forms. So the form name or names that I pass in
the dictionary to the response can also be named anything and aren't
required to be of a specific form name format right?
On Jan 7, 9:57 am, hank23 wrote:
> I see. So then I would code it something like this then:
&g
I want to code a form which will have a choice field which I want to
have rendered as a dropdown box in my html file. How do I code the
choices parameter in the form definition to bind it to a column in one
of my data tables in my model? The documentation shows a few examples,
but nothing specifica
, 2011 4:47:43 PM UTC, ShawnMilo wrote:
>
> > On 01/07/2011 11:33 AM, hank23 wrote:
> > > I want to code a form which will have a choice field which I want to
> > > have rendered as a dropdown box in my html file. How do I code the
> > > choices parameter in the f
? And then also follow
that parameter with any other optional ones, like widget, etc.?
On Jan 7, 1:03 pm, hank23 wrote:
> So I can create a queryset and pass its variable in the choices
> parameter to bind a modelchoicefield from a modelform to a particular
> iterable object? So then
key with Django is to understand when
> you need a modelform, and when you need a regular form.
>
> modelform - Django builds forms from models.
> form - You design what you want, but have to do a lot more work to populate
> the form with data.
>
> There you go.
>
> O
I have coded a new form with a ModelChoiceField defined on it which is
getting the following error:
TemplateSyntaxError at /admin/
Caught TypeError while rendering: __init__() takes at least 2
arguments (6 given)Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.2.4
Ex
This is my first attempt at trying to code a form and use it in a
view, so I've probably got something wrong. At this point I just
wanted to produce the screen with all of the fields displayed on it,
just to see if I have things coded correctly to display the screen the
first time.
I'm not getting
I have a couple of questions regarding formatting fields on a screen
which are coming from a form.
First is it possible to conditionally hide a form field on a screen
until an item from a dropdown box has been selected? If so how can
that be done?
Second I have some message fields defined in a fo
Is there something like a label widget available? If so where is it
defined? I didn't notice it listed in the forms wigdets document at:
http://docs.djangoproject.com/en/1.2/ref/forms/widgets/
On Jan 10, 11:46 am, Shawn Milochik wrote:
> 1. AJAX (try jQuery).
>
> 2. Change the field's widget.
then change the type in the javascript or do I mkae
the field originally a text input field, but somehow set it to be
invisible initially?
On Jan 10, 12:03 pm, Tim Sawyer wrote:
> On 10/01/11 17:44, hank23 wrote:
>
> > First is it possible to conditionally hide a form field on a sc
Regarding question two from above (displaying messages without text
input boxes): I want to display the fields as informational at least
for now only as a debugging tool, but may keep one of them later after
I've pretty much got the screen format finalized. That's why they
should be label fields on
Can someone tell me whether hiding a text input formfield is better
than just disabling it and which is easier to implement?
--
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 u
I'm getting this error:
IndentationError at /polls/addchoice/
unindent does not match any outer indentation level (views.py, line
125)Request Method: POST
Request URL: http://127.0.0.1:8000/polls/addchoice/
Django Version: 1.2.4
Exception Type: IndentationError
Exception Value: unindent does not m
Possibly so. I will check. Thanks.
On Jan 10, 3:59 pm, Shawn Milochik wrote:
> Is there a chance you have a mixture of literal tab characters and spaces?
> That would do it.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this grou
I have a text field on a page which I want to disable when the page is
loaded and enable later when the user selects an entry in a dropdown
box. First how and where do I code the call to my disablefield
function when the page loads? Second what event is generated whenever
I select an entry in a dro
parating them with a semicolon? Please advise. Thanks.
On Jan 12, 2:40 pm, Piotr Zalewa wrote:
> Is it in django-admin or completely irrelevant to this mailing list?
>
> zalun
>
> On 01/12/11 20:32, hank23 wrote:
>
> > I have a text field on a page which I want to disable when the
I have a screen which displays just fine the first time in, however
when I knowingly submit the page without entering data in all of the
fields to cause an error the page loses some of the data and controls.
I'm sure my view code is probably missing something just not sure at
this point what exactl
Thanks for the help. I'll modify my code accordingly.
On Jan 14, 6:27 am, Daniel Roseman wrote:
> On Thursday, January 13, 2011 7:30:56 PM UTC, hank23 wrote:
>
> > I have a screen which displays just fine the first time in, however
> > when I knowingly submit the page w
1. Is there a way to look for particular errors within the form.errors
dictionary by somehow specifying either a message key or value? If so
what's the format?
2. Is it possible to specify the format of error messages displayed
say as a paragraph instead of a list item or with a specific color
lik
I'm in the process of coding the logic to send email through the
send_mail package of Django. My question is what's the best way to
support sending an email to multiple recipients? I had thought of
using a text box to enter each address individually and then having a
button click call a javascript
OK. Any idea if there's a good django coding example somewhere showing
basic settings for sending email, how to setup the smtp connection so
I can use it to send multiple messages if desired, without having to
get a new connection for each message, etc.?
On Jan 19, 4:09 pm, Shawn Milochik wrote:
OK what exactly is django-mailer?
On Jan 19, 4:32 pm, Eduardo Cereto Carvalho
wrote:
> django-mailer[1] is a nice application to have around if you're planning to
> send too much emails. It queues messages and retry failled attempts.
>
> [1]
>
>
>
>
>
> On Wed, Jan 19, 2011 at 8:09 PM, Shawn Milo
I have a text field for entering a destination email address. Once the
address is entered I want to click a button on my screen which will
then append the new email address to another textarea field on the
screen, which will hold the entire list of recipients of the email
message. I would like my b
Here's my javascript function code:
function addRecipient()
{
alert("Entering addRecipient function!")
var list = document.getElementById('recipientlist');
var rlist = list.value;
var reciever = document.getElementById('recipient');
rlist = rli
gt;
> But the rest of the code only set a bunch of variables, it's not printing
> anything, it's not launching any alert, so what are you waiting to happen?
>
> 2011/1/21 hank23
>
>
>
>
>
> > Here's my javascript function code:
>
I'm trying to write the code and implement a file upload screen based
on this document:
http://docs.djangoproject.com/en/1.2/topics/http/file-uploads
I'm getting the following error:
Forbidden (403)
CSRF verification failed. Request aborted.
Help
Reason given for failure:
CSRF token missin
OK. I'll check all of that out, including the article. In the meantime
can you possibly explain the "title" field shown coded on the form in
the Django file upload document? It's shown coded on the form but I
don't think it's referenced anymore after that in the document and I
would like to know wh
I'm trying to code and implement a file upload screen. I've looked at
the documentation at:
http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/
and the document shows a simple upload form called UploadFileForm
which is shown with two fields coded for it. I'm assuming that the
field nam
wrote:
> On Thursday, January 27, 2011 3:53:57 PM UTC, hank23 wrote:
>
> > I'm trying to code and implement a file upload screen. I've looked at
> > the documentation at:
>
> >http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/
>
> > and the d
I have a file upload screen coded and working, whenever I enter all of
the data (original file selected from the browse button; as well as
target file path and name entered in a separate textbox) at one time.
But when I leave the destination file field blank after selecting the
original file an err
5:30 PM, hank23 wrote:
> > I have a file upload screen coded and working, whenever I enter all of
> > the data (original file selected from the browse button; as well as
> > target file path and name entered in a separate textbox) at one time.
> > But when I leave the de
I think I've read most of the documentation on Model Forms, but I
haven't seen much on how to customize them, other than changing the
order in which fields are displayed, or not displaying some fields at
all. The one ModelForm which I've done so far does not look very good
as it is automatically ge
in the case of Django, is
> actually enjoyable) is a Good Thing.
>
> On Jan 31, 7:37 pm, hank23 wrote:
>
>
>
> > I think I've read most of the documentation on Model Forms, but I
> > haven't seen much on how to customize them, other than changing the
> >
I have coded a form which will display some data in a dropdown
selection box. The data is being populated from a a queryset that I
have setup in the form's code. However the entries in the dropdown
only display as objects of the table from which they're being
retrieved, and don't display the actual
How do I specify which field of data to display in a dropdown box,
that is being populated by a queryset, in a form definition? And then
also how do I also specify the underlying non-dispalyed key data for
each entry in the same dropdown?
--
You received this message because you are subscribed to
Is it possible to code something to cause the default widget of a
field to not be displayed on a screen and code the desired html
element manually instead?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djan
I'm in the process of trying to write code that will check to see if a
folder already exists and if it doesn't I want it to display a new
screen or dialog box while still keeping the existing screen. The new
screen or dialog box should show an error saying the folder does not
exist and asking for c
Is there anyway in a form definition to specify how the options for a
select widget are to be coded when they're be generated automatically?
Specifically is there a way to specify where the value and the
displayed data attributes of the generated options are to pull that
data from when they're form
> desktop app. For this, you will need to use javascript. A javascript
> library, such a jQuery, will have such facilities "built-in"
> e.g.http://jqueryui.com/demos/dialog/#modal-confirmation
>
> On Feb 9, 9:18 pm, hank23 wrote:
>
>
>
> > I'
I'm trying to use raw SQL to retrieve the information that I want to
display in a dropdown list. Here's the error that I'm getting:
TemplateSyntaxError at /polls/updatepath/
Caught AttributeError while rendering: 'RawQuerySet' object has no
attribute 'all'
I'm not sure what this is trying to tell
ordering to your custom SQL)
>
> So, instead of trying to call all() on the QuerySet, just iterate over
> it -- rather than
>
> {% for obj in my_raw_query_set.all %}
>
> just do
>
> {% for obj in my_raw_query_set %}
>
>
>
>
>
> On Thu, Feb 10, 2011 at 7:
I'm getting the following error when I try to run a view from a new
screen:
DatabaseError at /polls/addcomment/
table polls_comment has no column named emailcomments
I've checked the spellings and they appear to be correct. In my
Comment table I have the emailcomments field defined as a boolean
f
I've been through the documentation and have been unable to find an
example of how to define a BooleanField when writing the code for a
table in my models.py file. Specifically are there any required
parameters when coding a BooleanField in a table definition? Thanks
for the help.
--
You received
. So this makes me think I still don't have
something setup right. Would it help if I posted my code somewhere so
you could take a look at it?
On Feb 11, 8:32 am, Tom Evans wrote:
> On Fri, Feb 11, 2011 at 2:23 PM, hank23 wrote:
> > I've been through the documentation and have
for a table like this? Do you just code the
__unicode__ method multiple times, once for each column, and just vary
the column data to be returned to be the name each column or how is it
done? I appreciate any help you can provide. Thanks.
On Feb 11, 9:32 am, Tom Evans wrote:
> On Fri, Fe
Are there any exampels of how to code Progress bars or the handlers
which support them somewhere in the django documentation? they're
referenced in the documentation, but without showing any actual coding
examples.
--
You received this message because you are subscribed to the Google Groups
"Dja
I have coded a table which looks like this:
class Comment(models.Model):
title = models.CharField(max_length=1,choices=TITLE_CHOICES)
firstname = models.CharField(max_length=15)
lastname = models.CharField(max_length=25)
commenttext = models.CharField(max_length=500)
emailaddre
com
> Subject: Re: Model Codng/Model Usage Pitfall?
>
> On Mon, Feb 14, 2011 at 5:21 PM, hank23 wrote:
> > I have coded a table which looks like this:
>
> > class Comment(models.Model):
> > title = models.CharField(max_length=1,choices=TITLE_CHOICES)
> >
keep my table definitions updated properly by some
manual process? Thanks for the help.
On Feb 14, 11:36 am, Tom Evans wrote:
> On Mon, Feb 14, 2011 at 5:34 PM, hank23 wrote:
> > OK. I will change it to an EmailField and see if that helps. However I
> > have a further question.
ll django command extension
> (http://code.google.com/p/django-command-extensions/) and take sqldiff output
> to modify your DB
> 3) Use South migration tools (the harder)
>
> Regards,
> Xavier.
>
> Le 14 févr. 2011 à 19:07, hank23 a écrit :
>
>
>
> > I think
I'm trying to get used to working with django's user authentication
framework and want to display the permissions for a user I've created.
When I try to display the the permissions that I get back from
user.user_permissions I had assumed that something like a list would
be returned and be iterable,
I have an application and I have figured out how to always send an
unauthenticated user to the login screen, no matter what screen they
try to enter when they're unauthenticated. First let me say that I
have not finished reading all of the documenation on the
authentication framework yet, so if the
Thanks a bunch. It looks like its all there. Thanks again!!
On Feb 15, 1:59 pm, Shawn Milochik wrote:
> See the 'next' stuff:
>
> http://docs.djangoproject.com/en/1.2/topics/auth/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
14, 4:56 pm, hank23 wrote:
>
>
>
> > Are there any exampels of how to code Progress bars or the handlers
> > which support them somewhere in the django documentation? they're
> > referenced in the documentation, but without showing any actual coding
> > ex
I downloaded and installed Django's South DB tool apparently ok
because after installing it I went into the shell and was able to
import South ok with no errors. So then I added it to the end of the
list of installed apps and also ran syncdb. When I ran syncdb I didn't
get anything that looked like
ughts?
On Feb 17, 9:44 am, Michael wrote:
> After you create the southtut app, you need to add it to
> settings.INSTALLED_APPS in order for Django to know about it. If Django
> doesn't know about it, then South doesn't know about it.
>
> --
> Michael
>
>
>
Is it possible to use external javascript files with a django app? If
so what folder does the javascript file need to be placed in? So far I
tried putting it in the bas folder of the app. I want to use it in and
it doesn't seem to work there if I reference it directly using only
just the filename i
Thanks. I'll take a look.
On Feb 17, 11:51 am, Marcos Moyano wrote:
> you need to put it in your media folder.
>
> http://docs.djangoproject.com/en/1.2/howto/static-files/
>
> Rgds,
> Marcos
>
>
>
>
>
> On Thu, Feb 17, 2011 at 2:44 PM, hank23 wrote:
>
Thanks for the help. I found the problem and now I have my migration
file(s) and I'm ready to migrate.
On Feb 17, 12:07 pm, Shawn Milochik wrote:
> On Thu, Feb 17, 2011 at 11:26 AM, hank23 wrote:
> > Ok I added the southtut app to my installed apps after creating its
> > fo
Let me preface the following information by saying that I’m trying to
build this into the polls application that I built in the introductory
django tutorial. The document I’m looking at is here:
http://docs.djangoproject.com/en/1.2/howto/static-files/
And it says this:
How to do it¶
Here’s the
I have an html page which I'm trying to code. On it I have a form with
multiple html controls/elements. In order to reference the elements on
the page can I reference them directly with a
document.getElementBy('') or do I need to reference them with the form
id as a prefix? If so how do I code that
On some web pages the user is prompted to type in a series of randomly
generated characters which appear on the screen, in order to limit
access of those pages to real users instead of allowing bots to also
access them. Now my question is is there a plug-in, sample code, or
outright django document
I'm trying to use the the built-in authentication framework/middlework
but so far haven't figured out how to use it correctly. I'm just
starting a new project with this and I have placed the
"@login_required" decorator in front of my first view and want to
force the user to login at this time. I ha
I get the following error whenever I try to go to the index screen of
a new app. I've started:
ViewDoesNotExist at /mymedia/
Tried index in module mymedia.views. Error was: 'module' object has no
attribute 'Text'
I've not been able to see or find anything obvious in my urls.py at
either the proje
e the form formatted correctly. Thanks again for
all the help.
On Mar 15, 9:23 am, Karen Tracey wrote:
> On Tue, Mar 15, 2011 at 10:14 AM, Tom Evans wrote:
>
> > On Tue, Mar 15, 2011 at 2:03 PM, hank23 wrote:
> > > I get the following error whenever I try to go to the index
I'm trying to figure out how to code the template language to assign
an index number to the "value" attribute of an option in a select
list, as I build the option list using a for loop. I can't seem to
find any examples of doing this in the django documentation. So is
this done automatically by dja
I have a new html screen which has fields on it which are not
rendering properly as month, day and year fields like this:
Month Day
Year
I have copied much of this code from anothe html screen on which these
same fields do render properly. So what might cause them and all of
the other fie
Is it possible to specify a default selected option for the
forms.Select widget of a forms.CharField form field? If so how is it
coded? Here is my current widget's code from my form definition:
widget=forms.Select(attrs={ 'name': 'rptlist', 'id': 'rptlist',
'size': '1', 'select-one': 'select-one',
though, so not a problem. Thanks for the
help.
On Mar 17, 10:02 am, Tom Evans wrote:
> On Thu, Mar 17, 2011 at 2:58 PM, hank23 wrote:
> > Is it possible to specify a default selected option for the
> > forms.Select widget of a forms.CharField form field? If so how is it
> &
If I want to define a global variable that can be accessible by all of
my views can I just define it at or near the top of my views.py and
and also outside of any defined view?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this grou
I'm currently working on a new project which will have multiple
applications built within it, and which will all be using the same
database. I'd like to setup a global name for each application so I
can use them to format audit fields for each application whenever
database updates are taking place
Is it possible to move data from one posted screen text field to
another? I have a group of three screen text fields which are
identical in all ways except one. Only the first one is required,
while the other two are optional. So if a user mistakenly enters data
into say field two or field three, w
OK thanks.
On Mar 18, 10:35 am, Matt Robenolt wrote:
> You can't import a specific variable, you import the settings "package" and
> access the variable from it:
>
> from django.conf import settings
> print settings.APP_NAME1
>
> But as Calvin says, this should not change throughout the project.
The order or priority of the fields are not important, but having a
minimum of at least one is, so that's why I wanted to save the user
some keystrokes by putting any data input into either field two or
three into field one if it's empty. I'm looking at the form and field
documentation now to try t
ow do I get past this? Are
all of the edits run for fields, even when they're not marked as
required?
On Mar 18, 12:28 pm, Shawn Milochik wrote:
> On Fri, Mar 18, 2011 at 12:55 PM, hank23 wrote:
> > The order or priority of the fields are not important, but having a
> > m
In the view for the most part I'm just returning the same screen back
if there are errors, and if there are no errors then it should go to a
completely different screen and just output some messages. Right now
view code is little better than a skeleton, because I just started it
and I'm just checki
Not a problem. Tell me where I can post it and what you'd like to see
and thanks for the help.
On Mar 18, 1:49 pm, Shawn Milochik wrote:
> If you post code I will look at it, but I'm not keen to guess.
--
You received this message because you are subscribed to the Google Groups
"Django users"
OK. It'll be there shortly. I'll send you a note directly once it's
there. Thanks.
On Mar 18, 2:08 pm, Shawn Milochik wrote:
> http://dpaste.com/always works.
>
> I guess the view and the form.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
OK I'll start checking stuff then. Even when you have errors on a
screen all of the data previously entered should still be returned
back to the screen with the errors right?
On Mar 18, 2:47 pm, Shawn Milochik wrote:
> Do you know for certain that you're getting past this line?
>
> if request
Not not at all. Sorry didn't realize that not posting it was bad form.
Here's the link:
http://dpaste.com/514877/
On Mar 18, 3:12 pm, werefr0g wrote:
> Hank,
>
> Would you mind posting the link on the list? I may be wrong, but I
> believe that sending a message directly to someone is not in th
1 - 100 of 109 matches
Mail list logo