Re: form validation does not work

2008-12-30 Thread Alex Koshelev
Please post here entire view code On Wed, Dec 31, 2008 at 8:18 AM, Chuck22 wrote: > > class ContactForm(forms.Form): > email = forms.EmailField(required=True, > widget=forms.TextInput(attrs= > {'size':'30'}), >

form validation does not work

2008-12-30 Thread Chuck22
class ContactForm(forms.Form): email = forms.EmailField(required=True, widget=forms.TextInput(attrs= {'size':'30'}), error_messages={'required':'Please fill out your Email'}) ... in my form html file: ... label

Re: Calendar

2008-12-30 Thread Praveen
I want a calendar on simple html page.. i do now want to use widget. In a plain html page how we may display calendar. Karen Tracey wrote: > On Tue, Dec 30, 2008 at 7:51 AM, Praveen > wrote: > > > > > Hi All, > > I want to use calendar in my html template as the

Model fields and arrays?

2008-12-30 Thread schwim
I'm trying to build a model that will store the counts of each of 10 possible choices, e.g.: v1 = models.IntegerField(default=0) v2 = models.IntegerField(default=0) v3 = models.IntegerField(default=0) ... v10 = models.IntegerField(default=0) I'd prefer to represent this as

specify alternative settings.py file at startup

2008-12-30 Thread dick...@gmail.com
i'm confused on the --settings option on manage.py. if i have a project call foo, i'd have in ./foo/settings.py to run: python manage.py runserver 8080 let's say i have a bar.settings.py which contains different values (like test database to use or something), i'm trying to run: python

Re: Looking for Django tutorial that illustrates master/detail data models

2008-12-30 Thread ldm999
Thanks for your response. I should have been more clear. I'm looking for examples of views/forms to manage the children of a parent child model. Eg how to add/change/ delete a book on a book list. I don't recall the Django tutorial covering this and I just looked again. It appears to focus more

Re: one server, multiple sites...

2008-12-30 Thread garagefan
figured out the issue was with the * not including a port :) now, pages aren't actually working... NameVirtualHost *:80 ServerName www.site.net SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE

Re: Ordering ForeignKey lists in admin change view

2008-12-30 Thread Daniel Roseman
On Dec 30, 7:15 am, janedenone wrote: > Hi, > > this must be really simple, but all the references to ordering fields > did not explain how to do this: How can I change the order of entries > in foreign key lists in the admin change view? > > Kind regards, > Jan

Re: Getting SQL from QuerySet

2008-12-30 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 5:11 AM, Info Cascade wrote: > > Hi -- > > I am getting intermittent errors on certain database queries on our > production server. > I am having a hard time duplicating them (most of the time they run > okay, only sometimes on the production

Re: Getting SQL from QuerySet

2008-12-30 Thread flo...@gmail.com
I think that >>> print my_query_set.query.as_sql() should do the trick. Thanks, Eric Florenzano On Dec 30, 12:11 pm, Info Cascade wrote: > Hi -- > > I am getting intermittent errors on certain database queries on our > production server. > I am having a hard

Re: Django serializers and local/inherited model fields

2008-12-30 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 4:27 AM, psj wrote: > > Django's base serializers only serialize a model's local fields, not > inherited ones, which seems odd at first blush (if an Employee is a > Person, and a Person has a name, wouldn't I be likely to want to see > the

Re: Looking for Django tutorial that illustrates master/detail data models

2008-12-30 Thread Daniel Roseman
On Dec 30, 8:22 pm, ldm999 wrote: > Eg: > Lists (books, movies, restaurants) and multiple items per list. > > Web forms would allow user to: > - Add/change/delete lists > - Add/change/delete list items > > TIA Have you actually read the tutorial on the Django site? The

Looking for Django tutorial that illustrates master/detail data models

2008-12-30 Thread ldm999
Eg: Lists (books, movies, restaurants) and multiple items per list. Web forms would allow user to: - Add/change/delete lists - Add/change/delete list items TIA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

one server, multiple sites...

2008-12-30 Thread garagefan
and i don't want one to access another's django installation... and the following doesn't seem to work NameVirtualHost * ServerName www.website.net SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE

Re: working with shp files and geodjango

2008-12-30 Thread Justin Bronn
The numbers have different values because the shapefiles have data in different coordinate systems. It looks like the data for that shapefile is actually for the 3435 SRID: http://spatialreference.org/ref/epsg/3435/ (3084 a NAD83 projection for all of Texas!). Unfortunately, most shapefiles

manage.py test without using a database?

2008-12-30 Thread Bo Shi
Hi, One of our django applications does not use django's ORM. Is there a way to run ./manage.py test my_app Such that it does not perform test database setup? Thanks, Bo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Configuring mod_python and Djano on Apache2

2008-12-30 Thread Graham Dumpleton
On Dec 31, 8:41 am, tosh wrote: > it depends on the url structure of your site really > > if you don't need your django site to load from the root you could > just do something like > > >     SetHandler None > Don't need SetHandler None at root needed if mounting at sub

Re: Configuring mod_python and Djano on Apache2

2008-12-30 Thread tosh
it depends on the url structure of your site really if you don't need your django site to load from the root you could just do something like SetHandler None SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE Test.settings

Re: Test database is not getting created.

2008-12-30 Thread sudha
yes. there was only .pyc file . Ie for settings.py. On Dec 30, 3:29 pm, "Karen Tracey" wrote: > On Tue, Dec 30, 2008 at 2:49 PM, sudha wrote: > > > I'm a total newbie to django. I have to test some of ui models. When I > > run manage.py test; Django

FormWizard: Setting up a ChoiceField.choices based on previous forms,

2008-12-30 Thread Ariel Mauricio Nunez Gomez
Hello list, Today I started using FormWizard and could not find a clean way to populate a choices field based on previously submitted forms, I ended up overriding the render method like this(The only changed line is the one highlited): {{{ class CountryForm(forms.Form): country =

building an application interface

2008-12-30 Thread Michael
hi guys i would like to build an application interface in a given django application using the ContentType class and GenericRelations. the basic architecture shall be given by two tables: one organizing to be plugged resources (Resources), i.e. tables of other apps, using a

Re: Test database is not getting created.

2008-12-30 Thread Karen Tracey
On Tue, Dec 30, 2008 at 2:49 PM, sudha wrote: > > I'm a total newbie to django. I have to test some of ui models. When I > run manage.py test; Django complains as follows: > File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 35, > in defaulterrorhandler >

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Karen Tracey
On Tue, Dec 30, 2008 at 2:37 PM, Peter wrote: > > (You don't say what version of Django you are using.) > > Sorry - 1.0 final > > > What you describe > > sounds similar to a few problems that have been reported. > > Ah yes. I looked. Thanks. Nasty. > > > but I believe the

Re: Joining models on M2M field

2008-12-30 Thread Andre P LeBlanc
I think what you're trying to do can be accomplished with the queryset's .extra() method. something like Level.objects.all().extra(select={'unlocked':'count(**matching rows in the join table**) > 0'}) -Andre On Dec 30, 7:04 am, Deniz Dogan wrote: > Hi > > I have a

Getting SQL from QuerySet

2008-12-30 Thread Info Cascade
Hi -- I am getting intermittent errors on certain database queries on our production server. I am having a hard time duplicating them (most of the time they run okay, only sometimes on the production server am I receiving exception messages), so I want to log the SQL query itself and see what it

Test database is not getting created.

2008-12-30 Thread sudha
I'm a total newbie to django. I have to test some of ui models. When I run manage.py test; Django complains as follows: File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 35, in defaulterrorhandler _mysql_exceptions.OperationalError: (1059, "Identifier name

Re: unable to access another field in cleaned_data from clean_

2008-12-30 Thread hotani
Thanks Karen - I think that got it. At least it's looking better than it has been. Apparently the missing field from 'cleaned_data' was caused by the wonky way I had it set up before. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter
> (You don't say what version of Django you are using.) Sorry - 1.0 final > What you describe > sounds similar to a few problems that have been reported. Ah yes. I looked. Thanks. Nasty. > but I believe the only way to > completely ensure you do not see this issue with PostgreSQL at present

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter
Thank you Ana, I checked that out - but I don't understand how it works (at least not without looking at the other models). Is Django less solid with Django than MySQL? I mean my example is a trivial 'text book' example and it did not work with PostgreSQL -- Peter On Dec 30, 6:49 pm, Ana

Django serializers and local/inherited model fields

2008-12-30 Thread psj
Django's base serializers only serialize a model's local fields, not inherited ones, which seems odd at first blush (if an Employee is a Person, and a Person has a name, wouldn't I be likely to want to see the Employees' names by default?) This looks straightforward to work around, but just

Re: unable to access another field in cleaned_data from clean_

2008-12-30 Thread Karen Tracey
On Tue, Dec 30, 2008 at 2:21 PM, hotani wrote: > > -- Update -- > > If I make the clean method for 'county', it works. I guess county > comes after case_no so both are accessible by that time. Weird, but I > can deal with it. However, that brings me to the 2nd issue with this >

Re: Looking for Django-Pinax developers for music production community

2008-12-30 Thread James Matthews
Thank you for your interest in Django. You may also post this job offer on djangogigs.com Much Success James On Mon, Dec 29, 2008 at 8:00 PM, Pancrazio wrote: > > Hi group! > > we are a startup working on a community-based music production > website. > > We are

Re: Django with shared host FastCGI

2008-12-30 Thread James Matthews
Which host are you using? I am on dreamhost and it works very nice. also try searching on google your hosts name and django to see if someone created a tutorial on it. On Tue, Dec 30, 2008 at 12:57 AM, James Gregory wrote: > > I tried using the guide here: >

Re: unable to access another field in cleaned_data from clean_

2008-12-30 Thread hotani
-- Update -- If I make the clean method for 'county', it works. I guess county comes after case_no so both are accessible by that time. Weird, but I can deal with it. However, that brings me to the 2nd issue with this process: Whatever is accessed in the clean method is no longer accessible for

Re: Sending id to new template - beginners confusion

2008-12-30 Thread Ana
Hello Ramdas, Thanks! I will work on it. Ana On Dec 30, 10:54 am, "Ramdas S" wrote: > The models need to be rewritten. It might be a better idea use a DateField, > you need to not worry about having a seperate foreignkey for month and year. > > Try using a slug, instead of

unable to access another field in cleaned_data from clean_

2008-12-30 Thread hotani
I have 2 fields I'm working with in a custom clean method: - case_no - county the clean method is for case_no, so I have this: -- def clean_case_no(self): d = self.cleaned_data form_case_no = d['case_no'] form_county = d['county'] ... -- The form fails with KeyError on 'county'. How

Re: Sending id to new template - beginners confusion

2008-12-30 Thread Ramdas S
The models need to be rewritten. It might be a better idea use a DateField, you need to not worry about having a seperate foreignkey for month and year. Try using a slug, instead of searching based pubtitles. Check the models documentation, it will help you. Here are some tips, pubtitle,

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Ana
Hello Peter, I use Postgres and have success creating a manytomany table. See: http://dpaste.com/103824/ Ana On Dec 30, 10:29 am, Peter wrote: > I have two models: Person and Telephone. A person can have many > telephones but a telephone belongs to at most one person.

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Karen Tracey
On Tue, Dec 30, 2008 at 1:29 PM, Peter wrote: > > I have two models: Person and Telephone. A person can have many > telephones but a telephone belongs to at most one person. The models > are: > > [snipped] > Using PostgreSQL this allows me a single phone number for a person.

Re: Sending id to new template - beginners confusion

2008-12-30 Thread Ana
Hello Ramdas, The model is here: http://dpaste.com/103815/ The URL is here: http://dpaste.com/103816/ I've got quite a mess trying to figure out how to move between templates. I'm having a very hard time finding practical examples of this stage of Django. The admin and database piece was

Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter
I have two models: Person and Telephone. A person can have many telephones but a telephone belongs to at most one person. The models are: class Person(models.Model): name = models.CharField(max_length=50) def __unicode__(self): return self.name class Telephone(models.Model):

Re: Sending id to new template - beginners confusion

2008-12-30 Thread Ramdas S
fsafety/search_detail283, this does not make sense. Your regular expression in urls clearly is looking for a number. Can you dpaste the models and urls.py also Thanks Ramdas On Tue, Dec 30, 2008 at 11:23 PM, Ana wrote: > > Hello, > > Please see the following: > >

Sending id to new template - beginners confusion

2008-12-30 Thread Ana
Hello, Please see the following: http://dpaste.com/103798/ Thank you, Anna --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com

Permissions: is something wrong with them?

2008-12-30 Thread Artem Skvira
Hi all, I have some issues with django permissions model. Please bear in mind that I have just started learning django so feel free to correct me if I'm wrong :) First of all it was hard to find how one can add a custom permission to list of permissions of a model instance. I ended up with a

Re: Calendar

2008-12-30 Thread Karen Tracey
On Tue, Dec 30, 2008 at 7:51 AM, Praveen wrote: > > Hi All, > I want to use calendar in my html template as the default admin > interface uses. > http://docs.djangoproject.com/en/dev/topics/forms/media/#form-media Karen

Re: Validate uniqueness in forms

2008-12-30 Thread Karen Tracey
On Tue, Dec 30, 2008 at 7:22 AM, janedenone wrote: > > Hi, > > I was looking for a way to customize the error message when trying to > submit an existing value for a unique field (using a ModelForm). > According to this request

Calendar

2008-12-30 Thread Praveen
Hi All, I want to use calendar in my html template as the default admin interface uses. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: request.user is set to None

2008-12-30 Thread Roy
You might want to check if the context being passed to your template is a regular Context or a RequestContext. Only RequestContexts have the request.user available. Check the context_instance parameter in render_to_response:

Validate uniqueness in forms

2008-12-30 Thread janedenone
Hi, I was looking for a way to customize the error message when trying to submit an existing value for a unique field (using a ModelForm). According to this request (http://code.djangoproject.com/ticket/8913), I am not the first one to look for such a feature, and I'm happy to wait for it. My

Ordering ForeignKey lists in admin change view

2008-12-30 Thread janedenone
Hi, this must be really simple, but all the references to ordering fields did not explain how to do this: How can I change the order of entries in foreign key lists in the admin change view? Kind regards, Jan --~--~-~--~~~---~--~~ You received this message

Joining models on M2M field

2008-12-30 Thread Deniz Dogan
Hi I have a user profile which has a many-to-many relationship to a model Level. The relationship is called "unlocked" and says which levels a specific user has unlocked. Now I wish to retrieve all the levels but "joined" with the user's unlocked levels, so that I get a QuerySet containing

Re: Admin form got a wrong action address via lighttpd with fastcgi.

2008-12-30 Thread khsing
I have got the reason. just set FORCE_SCRIPT_NAME = '' in settings.py On Tue, Dec 30, 2008 at 10:41 AM, khsing wrote: > > I have done via this link > http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/ > > The login form is appeared, but the action of login

Re: select childless parents, i.e. base with no derived classes in model inheritance

2008-12-30 Thread Briel
The first query looks at the restaurant attribute in the place model, and gets all that have a NULL value in that field. Now I don't know the restaurant/place setup, the docs I read uses book/auther examples. It looks like that the restaurant field is ForeignKey, and should be able to work the

Re: Django in runfcgi mode does not have log even is daemonize=false

2008-12-30 Thread Alex Koshelev
How do you put messages to log? On Tue, Dec 30, 2008 at 7:08 AM, CG wrote: > > Hi, all I am using Django 1.02 + lighttpd , and I run my django app in > fastCGI mode using the following > > runfcgi method=prefork socket=/tmp/socket.sock > pidfile=/var/run/process.pid

Django is generating requests that result in untyped binary data download in FF 3.0

2008-12-30 Thread alex kessinger
Hi, I am having a problem that seems like a ghost. I can find where it's comming from. It doesn't happen all the time. But what happens is sometimes when I go to a page. instead of loading the page, the browsers askes me if I would like to download a file called untyped binary data. I am

Re: working with a returned object inside another class

2008-12-30 Thread Briel
Just a tip if you're not familiar with SQL, you can get django- evolution. It works with syncdb, in that syncdb will detect when an "evolution" of the db is needed like in the example above. It can't do everything, but it can do a lot if things for you, with some simple commands. A second thing.