Environment settings error when running unit tests in Django

2008-10-10 Thread Karthik Krishnan
Hi, I am trying to run a unit test for my models. My unit test is as follows import os import unittest from myproject import models DJANGO_PATH = "DJANGO_SETTINGS_MODULE" os.environ[DJANGO_PATH] = "myproject.settings" class ModelsTestCase(unittest.TestCase): user = None def setUp(self):

Help Getting an error "invalid keyword argument for this function"

2008-10-02 Thread Karthik Krishnan
I have the following table in models.py class SiteAccessProcess(models.Model): """Object model mapping to the site_access_process table. Each element in the class represents a table column. """ instance_id = models.DecimalField( blank=False, max_digits=32, decimal_places=0, h

Re: A Newbie question: Need advice on how to create generic html templates with models

2008-09-25 Thread Karthik Krishnan
Thanks for replying Daniel. I wanted to know if I can use generic views for web application form objects. I would like to use them to avoid duplication on html pages. On Sep 25, 1:20 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Sep 25, 8:51 pm, Karthik Krishnan <[EMAIL PROTE

A Newbie question: Need advice on how to create generic html templates with models

2008-09-25 Thread Karthik Krishnan
I know this may be a stupid question but please bear with me. Here is my problem In views.py I have a multiple methods, where each method is mapped to a unique model. There may be multiple methods mapped to the same model. But no method in views.py is mapped to multiple models. For a GET/POST re

Re: Newbie Question: How to display only error messages when form validation fails?

2008-09-19 Thread Karthik Krishnan
It throws a debug error page. On Sep 18, 10:01 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On Friday 19 Sep 2008 7:02:06 am Karthik Krishnan wrote: > > > The premise is this: If the form validation fails, I want to display > > all the validation error messages on

Newbie Question: How to display only error messages when form validation fails?

2008-09-18 Thread Karthik Krishnan
Hi, The premise is this: If the form validation fails, I want to display all the validation error messages on the top of the page in a special div tag that I have created. {% for field, message in form.errors.items()%} {{message}} {% endfor %} returns a compilation error. I don't want to d

Re: Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Karthik Krishnan
Hi Daniel, Thanks for your solution. It worked. Thanks, Karthik On Sep 18, 1:46 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Sep 18, 9:34 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have a form which contains some prefilled data an

Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Karthik Krishnan
Hi, I have a form which contains some prefilled data and some to be filled in by the user. I have no trouble getting the forms to be prefilled. What I want is thatfor a GET request, if the form data pre exists, then display it; if not, then show a blank text field . For a post request, if the fie

Re: Can not under stand the error obtained when validating a model.py

2008-09-18 Thread Karthik Krishnan
Hi Steve, That was the problem. My django package was corrupted. Reinstalling django package worked. Thanks, Karthik On Sep 17, 4:56 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Karthik Krishnan wrote: > > Hi Norman, > > > But if I have an empty file, models.py, tha

Re: Can not under stand the error obtained when validating a model.py

2008-09-17 Thread Karthik Krishnan
Hi Norman, But if I have an empty file, models.py, that should thrown an error. Thanks, Kartik On Sep 17, 1:45 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Karthik Krishnan wrote: > > The stack trace is given below > > > Traceback (most recent call last

Can not under stand the error obtained when validating a model.py

2008-09-17 Thread Karthik Krishnan
The stack trace is given below Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "c:\tools\Python25\Lib\site-packages\django\core\management \__init__.py", line 340, in execute_manager utility.execute() File "c:\tools\Python25\Lib\site

Re: Can not set up project with Django-admin.py

2008-09-09 Thread Karthik Krishnan
Sorry duplicate. Accidentally pressed send twice On Sep 9, 12:37 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > Hi, > > When I try to use django-admin.py to set up my project, > > this is the error that I get > > chmod:  changing permissions of 'django-adm

Newbie question Can not set up project using Cygwin on Windows Vista

2008-09-09 Thread Karthik Krishnan
Hi, I am sure that this issue has come up before but I could not find in the forum mailing list. When I try to run chmod +x django-admin.py , I get the following error. chmod: changing permissions of `django-admin.py': Permission denied Is there something I am doing wrong? Any help would be ap

Can not set up project with Django-admin.py

2008-09-09 Thread Karthik Krishnan
Hi, When I try to use django-admin.py to set up my project, this is the error that I get chmod: changing permissions of 'django-admin.py' Permissions denied In addition, I can not set up a project that I want. I am running django on Windows Vista with a Cygwin shell. Is there anything I can