Need Help Understanding How To Use Built-In Authentication

2011-04-04 Thread hank23
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

Re: Need help: request.POST.copy() ?

2011-03-31 Thread hank23
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

Re: Need help: request.POST.copy() ?

2011-03-31 Thread hank23
. 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

Re: Need help: request.POST.copy() ?

2011-03-31 Thread hank23
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

Need help: request.POST.copy() ?

2011-03-31 Thread hank23
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

Screen Fields and Dropdowns Not Capturing Changes To Data on Edit Screen

2011-03-31 Thread hank23
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

Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-03-30 Thread hank23
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

Form Field References When Writing Field Validators

2011-03-23 Thread hank23
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

Referencing Form Field Errors Lists in Views

2011-03-21 Thread hank23
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

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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"

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Defining global names

2011-03-18 Thread hank23
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.

Posted Screen Text Field Manipulation

2011-03-18 Thread hank23
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

Re: Defining global names

2011-03-18 Thread hank23
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

Defining global names

2011-03-18 Thread hank23
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

Re: How To Specify Initial/Default/Empty Entry For Dropdown Using the forms.Select Widget

2011-03-17 Thread hank23
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 > &

How To Specify Initial/Default/Empty Entry For Dropdown Using the forms.Select Widget

2011-03-17 Thread hank23
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',

Screen Fields Rendered Incorrectly

2011-03-16 Thread hank23
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

How to format the "value" attribute of an option in a Select List using the template language for loop

2011-03-15 Thread hank23
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

Re: Tried index in module mymedia.views. Error was: 'module' object has no attribute 'Text'

2011-03-15 Thread hank23
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

Tried index in module mymedia.views. Error was: 'module' object has no attribute 'Text'

2011-03-15 Thread hank23
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

Authentication Using django.contrib.auth.middleware.AuthenticationMiddleware

2011-03-11 Thread hank23
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

Question(s) Concerning Securing Pages From Bots?

2011-02-22 Thread hank23
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

Form/Element Javascript Coding

2011-02-21 Thread hank23
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

How To Serve Javascript, CSS, Files

2011-02-18 Thread hank23
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

Re: Problems Adding Django South Tool

2011-02-17 Thread hank23
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

Re: External Javascript Files

2011-02-17 Thread hank23
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: >

External Javascript Files

2011-02-17 Thread hank23
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

Re: Problems Adding Django South Tool

2011-02-17 Thread hank23
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 > > >

Problems Adding Django South Tool

2011-02-17 Thread hank23
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

Re: Progress Bar/ProgressBarUploadHandler Documentation Examples

2011-02-15 Thread hank23
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

Re: Authentication Framework Question

2011-02-15 Thread hank23
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

Authentication Framework Question

2011-02-15 Thread hank23
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

Django User Permissions

2011-02-15 Thread hank23
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,

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
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

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
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.

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
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) > >    

Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
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

Progress Bar/ProgressBarUploadHandler Documentation Examples

2011-02-14 Thread hank23
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

Re: Need to Find Examples of How to Define BooleanFields in DB Tables

2011-02-11 Thread hank23
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

Re: Need to Find Examples of How to Define BooleanFields in DB Tables

2011-02-11 Thread hank23
. 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

Need to Find Examples of How to Define BooleanFields in DB Tables

2011-02-11 Thread hank23
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

DatabaseError table at /polls/addcomment/ polls_comment has no column named emailcomments

2011-02-10 Thread hank23
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

Re: TemplateSyntaxError at /polls/updatepath/ Caught AttributeError while rendering: 'RawQuerySet' object has no attribute 'all'

2011-02-10 Thread hank23
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:

TemplateSyntaxError at /polls/updatepath/ Caught AttributeError while rendering: 'RawQuerySet' object has no attribute 'all'

2011-02-10 Thread hank23
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

Re: How To Code A Dialog Screen And Respond to It

2011-02-10 Thread hank23
> 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'

Specifying Select Widget Options

2011-02-09 Thread hank23
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

How To Code A Dialog Screen And Respond to It

2011-02-09 Thread hank23
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

Form Field Default Widgets

2011-02-08 Thread hank23
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

Specifying Field Data To Display in A DropDown

2011-02-08 Thread hank23
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

How To Populate A Dropdown List

2011-02-08 Thread hank23
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

Re: Model Forms Customization

2011-02-03 Thread hank23
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 > >

Model Forms Customization

2011-01-31 Thread hank23
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

Re: Screen Field Selected Data Lost When Submit Button clicked and screen error results

2011-01-28 Thread hank23
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

Screen Field Selected Data Lost When Submit Button clicked and screen error results

2011-01-27 Thread hank23
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

Re: File Uploads Form Field "title" Questions

2011-01-27 Thread hank23
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

File Uploads Form Field "title" Questions

2011-01-27 Thread hank23
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

Re: Forbidden (403) CSRF verification failed. Request aborted.

2011-01-27 Thread hank23
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

Forbidden (403) CSRF verification failed. Request aborted.

2011-01-25 Thread hank23
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

Re: Where Is My Javascript Code's Problem?

2011-01-21 Thread hank23
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: >

Where Is My Javascript Code's Problem?

2011-01-21 Thread hank23
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

How To Create A Button Control That Does Not Submit The Form

2011-01-21 Thread hank23
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

Re: Django Email

2011-01-21 Thread hank23
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

Re: Django Email

2011-01-21 Thread hank23
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:

Django Email

2011-01-19 Thread hank23
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

Checking for/Displaying form.errors

2011-01-14 Thread hank23
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

Re: Django Screen Errors

2011-01-14 Thread hank23
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

Django Screen Errors

2011-01-13 Thread hank23
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

Re: Javascript Questions

2011-01-12 Thread hank23
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

Javascript Questions

2011-01-12 Thread hank23
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

Re: IndentationError at /polls/addchoice/

2011-01-10 Thread hank23
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

IndentationError at /polls/addchoice/

2011-01-10 Thread hank23
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

Benefits of Field Hiding versus Field Disabling

2011-01-10 Thread hank23
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

Re: Screen/Form Fields

2011-01-10 Thread hank23
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

Re: Screen/Form Fields

2011-01-10 Thread hank23
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

Re: Screen/Form Fields

2011-01-10 Thread hank23
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.

Screen/Form Fields

2011-01-10 Thread hank23
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

Screen/Form/View Problem?

2011-01-10 Thread hank23
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

TemplateSyntaxError at /admin/

2011-01-07 Thread hank23
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

Re: How do I Bind a Form choice Field?

2011-01-07 Thread hank23
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

Re: How do I Bind a Form choice Field?

2011-01-07 Thread hank23
? 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

Re: How do I Bind a Form choice Field?

2011-01-07 Thread hank23
, 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

How do I Bind a Form choice Field?

2011-01-07 Thread hank23
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

Re: render_to_response format using forms

2011-01-07 Thread hank23
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

Re: render_to_response format using forms

2011-01-07 Thread hank23
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

Re: render_to_response format using forms

2011-01-07 Thread hank23
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

render_to_response format using forms

2011-01-07 Thread hank23
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

Re: Displaying DB Values in a Dropdown Box

2011-01-05 Thread hank23
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

Displaying DB Values in a Dropdown Box

2011-01-05 Thread hank23
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

Using Forms in Views Examples

2011-01-05 Thread hank23
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

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
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

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
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

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
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

TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
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

Using A Form

2011-01-04 Thread hank23
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   2   >