I'm trying to understand the authentication built-in to django and
have some questions. Since the built-in authentication seems to
provide many if not all of the forms and views needed, then do I need
to code anything but calls to those views, from my own views, which
will pass the various bits of
t; return render_to_response('contact.html', { 'form':form },
> context_instance=RequestContext(request))
> form = ContactEmailForm()
> return render_to_response('contact.html', { 'form':form },
> context_instance=RequestContext
.
On Mar 31, 8:24 pm, hank23 wrote:
> Currently I have logic in place that makes a copy of request.POST so
> it can put data from a record using a key, gotten from the previous
> bunch of POSTed data, on the screen for display purposes. This all
> works fine. But when I go in
en I try to write it to
the database, but nothing new is being saved, so that's why I'm
wondering why no new data is being saved.
On Mar 31, 8:07 pm, Sam Walters wrote:
> Hi hank23
> request.POST would be immutable.
>
> "QueryDict instances are immutable, unless you
I need to know when I can or should use request.POST.copy() when
processing screens, as opposed to when not to use it. I've used it
some, on one screen in particular, which seems to work fine for
displaying the data that I want to display, when I put the data on the
screen programatically from with
I have a screen with a form on it and the text fields values and the
dropdown box selected values that are changed do not appear to be
posted back to the view. How is this possible? When I go to the screen
originally I see all of the data that supposed to be there (often
times much of it is from th
I have an edit screen with more than a dozen fields on it of various
types (text/CharField, select/CharField, date/DateField). When I
refresh the screen sometimes I want to suppress all of the field
required errors generated by empty fields prior to the refresh
actually taking place. So far I have
I'm writing a new field validator and I don't want it to raise an
error if another field on the same form is not set to a certain value.
When I reference the other field which I'm not editting with this
validator I get this error:
global name 'rptlist' is not defined
So can I reference the othe
I'm trying to reference errors on a new form. In the html file code I
reference them as "{{ form.fieldname.errors }}". How do I reference
those same field's errors lists in a view before I display the screen?
My goal here is to assign the focus of the screen which is about to be
displayed to be the
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
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
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
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"
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
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
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
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.
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
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
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
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
> &
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',
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
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
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 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
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
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 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
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
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
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:
>
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
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
>
>
>
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
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
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
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
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,
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
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.
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)
> >
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
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
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
. 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
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
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
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 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
> 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'
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
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 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
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
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
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 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
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 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
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'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
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 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
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:
>
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
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
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
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:
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
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
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
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
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 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
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'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
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
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
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
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.
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
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 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
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
? 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
, 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
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
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
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
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
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
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
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
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
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
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
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
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
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
1 - 100 of 109 matches
Mail list logo