Re: Django Newbie Question (Exception Type: TypeError, Value: argument of type 'NoneType' is not iterable)

2011-05-24 Thread Alexandra
Ok I actually just figured it out. My issue was that I was calling the function instead of the actual instance of the form. I got confused because the variables were named almost identically. On May 24, 8:27 pm, Alexandra wrote: > Hi All, > > I am somewhat new to Django, although I have been prog

Django Newbie Question (Exception Type: TypeError, Value: argument of type 'NoneType' is not iterable)

2011-05-24 Thread Alexandra
Hi All, I am somewhat new to Django, although I have been programming in Python for a while. I installed Pinax and have been working on a site from one of the starter templates, and have an error I can't seem to wrap my head around. Exception Type: TypeError at /models/add Exception Value: argume

Re: django newbie question

2009-02-20 Thread nixon66
Alex, Thanks Ron On Feb 20, 2:37 pm, Alex Gaynor wrote: > On Fri, Feb 20, 2009 at 2:34 PM, nixon66 wrote: > > > eleom, > > > Thanks for the catch with country county in my model. > > > On Feb 20, 2:22 pm, eleom wrote: > > > Well, as the error message says, you must pass a County instance in

Re: django newbie question

2009-02-20 Thread Alex Gaynor
On Fri, Feb 20, 2009 at 2:34 PM, nixon66 wrote: > > eleom, > > Thanks for the catch with country county in my model. > > On Feb 20, 2:22 pm, eleom wrote: > > Well, as the error message says, you must pass a County instance in > > the argument 'county'. Now you are passing the name of the county,

Re: django newbie question

2009-02-20 Thread nixon66
eleom, Thanks for the catch with country county in my model. On Feb 20, 2:22 pm, eleom wrote: > Well, as the error message says, you must pass a County instance in > the argument 'county'. Now you are passing the name of the county, not > the county itself. So, your last line should be > > l =

Re: django newbie question

2009-02-20 Thread nixon66
Ahh!!! The light goes on. Thanks for the quick response. One additional question. How would you handle this if you are typing data into the admin and wanted to put in the county? On Feb 20, 2:22 pm, eleom wrote: > Well, as the error message says, you must pass a County instance in > the argumen

Re: django newbie question

2009-02-20 Thread eleom
Well, as the error message says, you must pass a County instance in the argument 'county'. Now you are passing the name of the county, not the county itself. So, your last line should be l = Company(name='xyz corp', address='56 b. street', client='G corp', city = 'Walla Walla', county=c, dollar_a

Re: django newbie question

2009-02-20 Thread Alex Gaynor
On Fri, Feb 20, 2009 at 2:06 PM, nixon66 wrote: > > If this is the wrong list to post a newbie question please let me > know. I'm getting an error message while trying to populate the tables > created by the models and not sure why. Here are the models > > from django.db import models > > class C

django newbie question

2009-02-20 Thread nixon66
If this is the wrong list to post a newbie question please let me know. I'm getting an error message while trying to populate the tables created by the models and not sure why. Here are the models from django.db import models class County(models.Model): name = models.CharField(max_length=80)

Re: Django newbie question re: porting from Google App Engine to Django standalone

2009-02-01 Thread Rama Vadakattu
Please have a look at the below link: http://code.google.com/appengine/articles/pure_django.html May be it helps you in porting the app from appengine to django. --rama On Feb 1, 5:16 am, "Mark.Petrovic" wrote: > Good day.  I'm new here, as well as a new (all of two months of > experience) Pyth

Django newbie question re: porting from Google App Engine to Django standalone

2009-01-31 Thread Mark.Petrovic
Good day. I'm new here, as well as a new (all of two months of experience) Python web app developer. I'm interested in porting a Google App Engine "google.appengine.ext.webapp"-based app to a standalone Django app on another platform. I've ported my data models from GAE to Django, as well as my

Re: Django newbie question about views and authentication

2008-04-02 Thread Matias Surdi
Malcolm Tredinnick escribió: > > On Tue, 2008-04-01 at 15:42 +0200, Matias Surdi wrote: > [...] >> ¿Is this correct? Isn't it a bit tedious to do this with all views? What >> if I forget to add the RequestContext thing in a view? > > If you don't pass in the parameters that are required, the fu

Re: Django newbie question about views and authentication

2008-04-01 Thread SmileyChris
You can use the django.views.generic.simple "direct_to_template" view just like you would the render_to_response shortcut - it works the same except you pass in the request as the first argument: direct_to_template(request, 'template/index.html') On Apr 2, 2:42 am, Matias Surdi <[EMAIL PROTECTED

Re: Django newbie question about views and authentication

2008-04-01 Thread Malcolm Tredinnick
On Tue, 2008-04-01 at 15:42 +0200, Matias Surdi wrote: [...] > ¿Is this correct? Isn't it a bit tedious to do this with all views? What > if I forget to add the RequestContext thing in a view? If you don't pass in the parameters that are required, the function won't be able to use them. Surely

Django newbie question about views and authentication

2008-04-01 Thread Matias Surdi
Hi, Suppose I've the following on the top of every page of my application (in base.html for example): {% if user.is_authenticated %} Welcome, {{ user.username }}. Thanks for logging in. {% else %} Welcome, new user. Please log in. {% endif %} Now, as far as I understand I must ALWAY

Re: Django newbie question: saving composite objects.

2007-03-01 Thread Manoj Govindan
Hi Malcolm, > I would like to see if subProject.parent the first time you test it > (your first assert()) is exactly the same as after the subProject.save() > line. > I did a bit of debugging and uncovered the following facts. I think they explain the goings on pretty clearly. Let us take the s

Re: Django newbie question: saving composite objects.

2007-02-26 Thread Malcolm Tredinnick
On Mon, 2007-02-26 at 17:19 +, Manoj Govindan wrote: > Hi Malcolm, > After reading your post, I added a couple of assertions. > 1) Check for subProject.parent immediately after creating the > subProject object. > 2) Compare id()s of project and subProject.parent *after saving* > subProject. >

Re: Django newbie question: saving composite objects.

2007-02-26 Thread Manoj Govindan
Hi Malcolm, After reading your post, I added a couple of assertions. 1) Check for subProject.parent immediately after creating the subProject object. 2) Compare id()s of project and subProject.parent *after saving* subProject. The test now looks like this: class ProjectTests(unittest.TestCase):

Re: Django newbie question: saving composite objects.

2007-02-24 Thread Malcolm Tredinnick
On Sat, 2007-02-24 at 18:41 +, Manoj Govindan wrote: > Hi, > Consider a model and a simple test for the model. > > class Project(models.Model): > name = models.CharField(maxlength = 255) > parent = models.ForeignKey('self', null = True) > > class ProjectTests(unittest.TestCase): >

Django newbie question: saving composite objects.

2007-02-24 Thread Manoj Govindan
Hi, Consider a model and a simple test for the model. class Project(models.Model): name = models.CharField(maxlength = 255) parent = models.ForeignKey('self', null = True) class ProjectTests(unittest.TestCase): def testCreateProjectAndSubProject(self): project = Project(name