Re: how to implement multiple choices in model

2008-11-17 Thread Daniel Roseman
On Nov 18, 2:56 am, Canhua <[EMAIL PROTECTED]> wrote: > hi, I am trying to create such a kind of field in a model. The field > can only take one or more values from a set of value, each seperated > by such as commas. It seems that there is no built-in field type in > Django. How may I implement

Re: Default custom settings

2008-11-17 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-11-18, o godz. 03:29, przez mdnesvold: > > I'm writing an application that adds several app-specific settings. As > I'm developing, I'm just adding them to the end of my settings.py > file: > > MY_APP_FOO = 'foo' > MY_APP_BAR = ( > 'bar', > 'bam', > 'baz', >

Re: public html?

2008-11-17 Thread Horus Kol
yeah - that's the way I'd normally do it (with Apache)... but this development server thing was what was throwing. On Nov 18, 5:12 pm, Jonathan Lin <[EMAIL PROTECTED]> wrote: > By the way, that is the way to get django's development server to serve > up you files, and not necessarily the best

Re: public html?

2008-11-17 Thread Jonathan Lin
By the way, that is the way to get django's development server to serve up you files, and not necessarily the best way to go when you want to deploy your site. Your best bet is some sort of webserver like apache or lighttpd Jonathan Horus Kol wrote: > On Nov 18, 2:24 pm, Horus Kol <[EMAIL

Re: How to access the request object in a decorator

2008-11-17 Thread TH
Thanks a lot Bruno! That really helped :) On Nov 17, 3:20 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 17 nov, 10:02, TH <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I wanted to redirect a logged in user if he access certain page. For > > example i do not want the user to

Re: public html?

2008-11-17 Thread Horus Kol
On Nov 18, 2:24 pm, Horus Kol <[EMAIL PROTECTED]> wrote: > I've searched through and through the documentation at the Django > site, but can't find any information about this: > > What's the recommended setup for things like stylesheets and > javascripts? > > How do you setup the redirects?

Re: Update Values to Null

2008-11-17 Thread Merrick
But of course! Thank you. On Nov 17, 8:25 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 9:06 PM, Merrick <[EMAIL PROTECTED]> wrote: > > > I cannot figure out how to update a foreign key to a null value. > > Thanks. > > > models.py > > > > group =

Re: Built-in Reference - docutils

2008-11-17 Thread Horus Kol
James, Thanks for that - worked a treat. --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send

Re: New Django install on Win Vista-problem

2008-11-17 Thread Karen Tracey
On Mon, Nov 17, 2008 at 9:58 PM, DSS <[EMAIL PROTECTED]> wrote: > > I just installed Django 2.6 on my Vista machine; followed installation > instructions explicitly. Python imports Django sucessfully. When I > try to run django-admin.py startproject ..., it does not run at the > command prompt.

Re: Built-in Reference - docutils

2008-11-17 Thread James Bennett
On Mon, Nov 17, 2008 at 10:26 PM, Horus Kol <[EMAIL PROTECTED]> wrote: > TemplateDoesNotExist at /admin/doc/ > > Anyone got any ideas? It helps to have the admin docs application (which is *not* 'django.contrib.admin', but rather 'django.contrib.admindocs') in your INSTALLED_APPS, so that its

Built-in Reference - docutils

2008-11-17 Thread Horus Kol
I've installed docutils and gotten past one error when trying to access the built-in reference documentation from admin site, but now I'm getting another error message: TemplateDoesNotExist at /admin/doc/ Anyone got any ideas? --~--~-~--~~~---~--~~ You received

public html?

2008-11-17 Thread Horus Kol
I've searched through and through the documentation at the Django site, but can't find any information about this: What's the recommended setup for things like stylesheets and javascripts? How do you setup the redirects? Anything special to dealt with it in the framework.

Re: Update Values to Null

2008-11-17 Thread Karen Tracey
On Mon, Nov 17, 2008 at 9:06 PM, Merrick <[EMAIL PROTECTED]> wrote: > > I cannot figure out how to update a foreign key to a null value. > Thanks. > > models.py > > group = models.ForeignKey(group, null=True, blank=True) > > >>> from redirect.models import * > >>> Links =

New Django install on Win Vista-problem

2008-11-17 Thread DSS
I just installed Django 2.6 on my Vista machine; followed installation instructions explicitly. Python imports Django sucessfully. When I try to run django-admin.py startproject ..., it does not run at the command prompt. I suspect it needs to be in the system path, but I'm not sure. Any clues?

Default custom settings

2008-11-17 Thread mdnesvold
I'm writing an application that adds several app-specific settings. As I'm developing, I'm just adding them to the end of my settings.py file: MY_APP_FOO = 'foo' MY_APP_BAR = ( 'bar', 'bam', 'baz', ) # and so on So far, I have eleven such settings over 21 lines and expect to add

Re: ImageField upload_to not workin

2008-11-17 Thread elm
Hi Javier, I am experiencing the same problem with 'upload_to'. Have you found the problem? Thx, elm On 14 nov, 18:31, Javier <[EMAIL PROTECTED]> wrote: > Hi, > > I've create a model: > > class ImagenesLugar(models.Model): >     archivo = models.ImageField(upload_to="imageneslugar/") >    

how to implement multiple choices in model

2008-11-17 Thread Canhua
hi, I am trying to create such a kind of field in a model. The field can only take one or more values from a set of value, each seperated by such as commas. It seems that there is no built-in field type in Django. How may I implement this? Any clue is greatly appreciated. Best wishes Can-Hua

Update Values to Null

2008-11-17 Thread Merrick
I cannot figure out how to update a foreign key to a null value. Thanks. models.py group = models.ForeignKey(group, null=True, blank=True) >>> from redirect.models import * >>> Links = Link.objects.filter(group = 6) >>> Links.update(group = NULL) Traceback (most recent call last):

Re: imagefield write error

2008-11-17 Thread prem1er
Ok, I figured that one out. I should be writing to within my Django project. How would I get this to work with apache permission? On Nov 17, 8:51 pm, prem1er <[EMAIL PROTECTED]> wrote: > Trying to write an image to my server for a user.  I keep getting the > error 'SuspiciousOperation,

Re: avoid cascade delete

2008-11-17 Thread Merrick
Thank you for all of the advice, it is nice to have so many options. I ended up using: group.link_set.clear() group.delete() On Nov 17, 7:57 am, "David Zhou" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 10:46 AM, Randy Barlow <[EMAIL PROTECTED]> wrote: > > > On Sun, 16 Nov 2008 23:21:05

Re: Tips for reading The Django Book in light of Django 1.0

2008-11-17 Thread webcomm
Pretty sure forms has changed. That is, the way admin forms are created/customized. In the book there is a brief explanation of upcoming changes involving what was at that time termed "newforms." I am fairly new to Django so can't be much more specific than that. -Ryan On Nov 17, 8:11 pm,

imagefield write error

2008-11-17 Thread prem1er
Trying to write an image to my server for a user. I keep getting the error 'SuspiciousOperation, Attempted access to '.../' denied. I tried adding read write and execute permissions to this directory and still no luck. from django.db import models class user(models.Model): avatar

Javascript and same origin policy

2008-11-17 Thread Matic Žgur
Hello, I'm having a problem with TinyMCE integration, but let me first describe how my current development setup looks like. Directory structure is like this: project.com |-project |--all the django stuff |-static |--static stuff including javascript and some php The thing is that the whole

Re: Tips for reading The Django Book in light of Django 1.0

2008-11-17 Thread Kenneth Gonsalves
On Tuesday 18 November 2008 02:38:03 am Ian Fitzpatrick wrote: > Can anyone recommend areas of The Django Book to skip over, or point > out areas that are potentially irrelevant/misleading given we are now > at Django 1.0?  I am a stubborn pursuer of dead ends, so am trying to > save myself some

Re: geodjango importing existing data - pointfields

2008-11-17 Thread Ariel Mauricio Nunez Gomez
> > 1,1,'Edinburgh Castle','Edinburgh','Lothian','EH1 2NG','POINT > (-3.20277400 55.95415500)' > > I've tried multiple variations on the POINT syntax (GeomFromText > etc...) but no joy. > > What am I doing wrong!!? > > Thanks in advance Have you tried the following EWKT?

Re: Order of Middleware

2008-11-17 Thread Steve Holden
Peter wrote: > When I run django admin and do startproject I get a settings file that > has: > > MIDDLEWARE_CLASSES = ( > 'django.middleware.common.CommonMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware',

validate fields in the admin as some local flavor form fields

2008-11-17 Thread TeenSpirit83
I'm writing an app with some italian zip and vat number fields and also a province select field can i force the admin class to validate the fields like class it.forms.ITVatNumberField class it.forms.ITZipCodeField class it.forms.ITProvinceSelect ??

Re: Tips for reading The Django Book in light of Django 1.0

2008-11-17 Thread jamesM
I do keep reading the Django book + DjangoDocs of the same topic at the moment. As first one is easier to read, the second one represents 1.0 version better. Also always check the DjangoBook's comment's - most of deprecated features are mentioned there and updated with more recent ones. Anyway,

Re: Sessions

2008-11-17 Thread Karen Tracey
On Mon, Nov 17, 2008 at 10:15 AM, srn <[EMAIL PROTECTED]> wrote: > > Hi, > I'm trying to work with the session object in my application but it > doesn't work as expected. > So in my settings.py I have: > > MIDDLEWARE_CLASSES = ( >'django.middleware.gzip.GZipMiddleware', >

Re: Python and/or django book

2008-11-17 Thread Gour
> "prem1er" == prem1er <[EMAIL PROTECTED]> writes: prem1er> Just trying to figure out what the best book to purchase for a prem1er> newcomer to Django and python. Thanks for your suggestions. Check this one - http://withdjango.com/ - I got it few days ago. Sincerely, Gour -- Gour |

Re: django unicode error

2008-11-17 Thread jamesM
Karen, thank You su much for the help! after executing "show create table' i realised there was a problem in my character_set+collation, changed it from latin1_swedish_ci (can't remember which charset it was)to utf8+utf8_general_ci, and now everything works like a charm. Thanks once again! all

Re: Items tree in Django

2008-11-17 Thread Fabio Natali
Gustavo Picón wrote: [...] > Disclaimer: I'm the author of django-treebeard Hi Gustavo, thanks for your reply and for your django-treebeard, which I'll surely use very soon! > You can look at the treebeard benchmarks in > http://django-treebeard.googlecode.com/svn/docs/index.html#module-tbbench

Re: Items tree in Django

2008-11-17 Thread Fabio Natali
Hi Malcom! And thank you very much for your kind reply. Malcolm Tredinnick wrote: [...] > 500 leaves is really nothing for the database. If you want to do > anything with that size tree, you can easily just use a simple nested > hierarchy like this, pull all the rows back into Python and work

Re: Python and/or django book

2008-11-17 Thread Justin Lilly
I would probably second Alley's suggestion if only because buying a book to learn a language when its already out of date is a huge pain. I made that mistake with RoR. The book Alley linked apparently (judging by the cover) is up to date with 1.0. -justin On Mon, Nov 17, 2008 at 3:33 PM, Alley

Re: Can't access the development server

2008-11-17 Thread bruno desthuilliers
On 17 nov, 14:14, Ben <[EMAIL PROTECTED]> wrote: > Hi, > > I'm completely new to python and Django, although fairly familiar with > programming and web servers in general. > > I'm struggling to get Django up and running, at the moment, and I'd be > really grateful if someone could help. > > I'm

Re: Python and/or django book

2008-11-17 Thread Peter
On Nov 17, 7:53 pm, prem1er <[EMAIL PROTECTED]> wrote: > Just trying to figure out what the best book to purchase for a > newcomer to Django and python.  Thanks for your suggestions. I always use Alex Matelli''s Python in a Nutshell (2nd edition now). You can access that and the Django book

Tips for reading The Django Book in light of Django 1.0

2008-11-17 Thread Ian Fitzpatrick
Hi All, I read through the Django Book just as the book went 1.0 a little less than a year ago, but as these things go I got sidetracked and never got to work on any substantial Django projects. Having forgotten a lot of what I learned, I'm thinking to work my way back through this book, but I

Re: Can't access the development server

2008-11-17 Thread Karen Tracey
On Mon, Nov 17, 2008 at 8:14 AM, Ben <[EMAIL PROTECTED]> wrote: > > [snip] > > I start the development server using: > > python manage.py runserver > > which seems to work ok: > > Validating models... > 0 errors found > > Django version 1.1 pre-alpha SVN-9479, using settings >

Re: Can't access the development server

2008-11-17 Thread Ludwig
I think the issue is that your server is only listening for incoming calls from the local (host) machine. The 127.0.0.1 is a kind of magic number that just means in IP-speak 'this machine'. Try running it as python manage.py runserver www.yourhost.yourdomain.com:8000 (suitably replaced by your

Can't access the development server

2008-11-17 Thread Ben
Hi, I'm completely new to python and Django, although fairly familiar with programming and web servers in general. I'm struggling to get Django up and running, at the moment, and I'd be really grateful if someone could help. I'm following this tutorial, after having successfully installed

Order of Middleware

2008-11-17 Thread Peter
When I run django admin and do startproject I get a settings file that has: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) In the

Re: Python and/or django book

2008-11-17 Thread Alley
One book i have sound useful to learn django has been Python Web Development with Django (http://www.amazon.com/gp/product/0132356139/ ref=s9sdps_c1_14_at4-rfc_g1-frt_g1-3237_p_si5? pf_rd_m=ATVPDKIKX0DER_rd_s=center-1_rd_r=1MF7GP27Q2DEWVDH8S5F_rd_t=101_rd_p=463383351_rd_i=507846) With this book

Re: Passing values to template

2008-11-17 Thread bruno desthuilliers
On 17 nov, 16:45, Alex Jonsson <[EMAIL PROTECTED]> wrote: > Hey guys, > > I have a news application that I would like some help with. > > My view generates a list with objects mixed with dictionaries with two > objects. (snip) > Or is there a better way of doing this other > than mixing objects

Re: Python and/or django book

2008-11-17 Thread Ovnicraft
2008/11/17 prem1er <[EMAIL PROTECTED]> > > I mean, yes they are always there, but I always like a good physical > reference. I have experience in OO languages, but not much server- > side programming just a little ASP .Net. > > On Nov 17, 3:09 pm, bruno desthuilliers > <[EMAIL PROTECTED]> wrote:

Re: Python and/or django book

2008-11-17 Thread prem1er
I mean, yes they are always there, but I always like a good physical reference. I have experience in OO languages, but not much server- side programming just a little ASP .Net. On Nov 17, 3:09 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 17 nov, 20:53, prem1er <[EMAIL PROTECTED]>

Re: Python and/or django book

2008-11-17 Thread bruno desthuilliers
On 17 nov, 20:53, prem1er <[EMAIL PROTECTED]> wrote: > Just trying to figure out what the best book to purchase for a > newcomer to Django and python. Depends on your background... But if you have prior experience with 1/ another (preferably but not necessarily object oriented) language and 2/

Python and/or django book

2008-11-17 Thread prem1er
Just trying to figure out what the best book to purchase for a newcomer to Django and python. Thanks for your suggestions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Views triggering twice

2008-11-17 Thread Jeff Gentry
> you've used the value "#fff", that will be interpreted by the browser as > a reference to the current page (#fff being an anchor, and not passed to > the server). Ergo, a second request is made. Wow, thanks. Just reading through your step by step taught me some things I didn't know :) > The

Re: link to ForeignKey in Admin's change list page

2008-11-17 Thread Daniel Roseman
On Nov 17, 4:42 pm, Paolo Corti <[EMAIL PROTECTED]> wrote: > Hi > maybe this is trivial, but i can't find a way to get it (and from what > i can see it seems not possible): > > my model: > > class Project(models.Model): >         name = models.CharField('name', max_length=255) >         >    

Re: Setting Up Django on Vista and Creating a Database

2008-11-17 Thread Peter Herndon
The other thing that comes to mind is, have you installed the MySQLdb python library? If you want to connect to a database from a Python app, you must also install a library that bridges Python and the database. (I apologize in advance if you've already done so). ---Peter On 11/17/08, Karen

Re: Items tree in Django

2008-11-17 Thread Gustavo Picón
Disclaimer: I'm the author of django-treebeard > I am glad to hear that the naive way could possibly fit my 3-levels > tree, or at least that it deserves a try. I'll have some benchmarks as > you suggest. You can look at the treebeard benchmarks in

Getting the most comment for integer id object

2008-11-17 Thread chatchai
Hi, I have a integer id model and I want to get the most comment (django.contrib.comments) for the model. I use postgres and I got the error about comparing integer(my model) and text (comment object_pk). Someone have any solution? Thanks, Chatchai

Re: psycopg2 Visual Studio installation error on XP

2008-11-17 Thread Peter Herndon
Hi DJ, Psycopg2 has a C extension wrapped by Python. That C extension must be compiled with the same compiler used to compile the Python compiler itself. This is not a Django issue, this is a psycopg issue. You should ask for assistance on the psycopg mailing list, they'll be better able to

Running multiple sites

2008-11-17 Thread Chris Stromberger
Noob question here. My web host allows one long running process per account for the plan I am on. So I can run one django process. The setup is using fastcgi if that matters (we don't have control over this--we are assigned a fastcgi port or something and this is the command we use to run our

psycopg2 Visual Studio installation error on XP

2008-11-17 Thread dj
Hello All, I am django novice and i am very, very ,very, very green. I am trying to setup the PostgresSQL database with the psycopg2 library. I downloaded the psycopg2-2.0.8.tar file. Opened the tar with Winzip and installed the library from the command line using python setup.py. I got this

Re: automatically save latitude and longitude of the address.

2008-11-17 Thread Adam Fast
I can see several causes here why you're not getting the desired result. The biggest one is you declare fnclatitude as taking a single argument, called location - but when you call the function from your save() method you're passing no arguments to it. Second, you're returning element 3 (which

Re: required checkboxes issue

2008-11-17 Thread Bobby Roberts
> Without looking at any docs or code, it seems you have a mismatch in the > number of values expected by the form (one) and what will be returned by the > widget (multiple).  Are you sure you don't really want to be using a > MultipleChoiceField? > > Karen That appears to have done it.

required checkboxes issue

2008-11-17 Thread Bobby Roberts
I have a problem with one of my forms in regard to a series of checkboxes. They are displaying properly on the page with the right values in the checkboxes. I have this set to REQUIRED in my form. However, whether I check one box, or check them all, I still get this message: "Select a valid

Re: required checkboxes issue

2008-11-17 Thread Karen Tracey
On Mon, Nov 17, 2008 at 11:37 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > I have a problem with one of my forms in regard to a series of > checkboxes. They are displaying properly on the page with the right > values in the checkboxes. I have this set to REQUIRED in my form. > However,

Re: Passing values to template

2008-11-17 Thread Alex Jonsson
Thanks to both of you! David's suggestion fits my application perfectly. Again, big thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

link to ForeignKey in Admin's change list page

2008-11-17 Thread Paolo Corti
Hi maybe this is trivial, but i can't find a way to get it (and from what i can see it seems not possible): my model: class Project(models.Model): name = models.CharField('name', max_length=255) #relationship projectowner = models.ForeignKey(Person) in

Re: Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
Thank you thank you thank you! I knew I was doing something simple wrong. :) I've been enjoying my experience using Django so far, but one thing I have noticed is that the error messages (or in this case lack of error messages) can be frustrating. It sometimes takes me quite a while to figure

Re: Passing values to template

2008-11-17 Thread Rajesh Dhawan
Hi Alex, > I have a news application that I would like some help with. > > My view generates a list with objects mixed with dictionaries with two > objects. Then in my template, I want to loop through this list and > output each value. However, when it encounters a dictionary in the > list I

Re: Serializing models to JSON

2008-11-17 Thread Rajesh Dhawan
Hi, > In my application I'm trying to serialize the following model to json: > > class Node(models.Model): > name = models.CharField(db_column="NAME", > max_length=30, > db_index=True) > description =

Re: Passing values to template

2008-11-17 Thread David Zhou
On Mon, Nov 17, 2008 at 10:45 AM, Alex Jonsson <[EMAIL PROTECTED]> wrote: > So the question is: how do I check (in the template) if the object > that is being run in the for loop is a dictionary, so that I in turn > can run a for loop on it? Or is there a better way of doing this other > than

Re: Frustration with custom Inline forms

2008-11-17 Thread Daniel Roseman
On Nov 17, 2:01 pm, Ben Gerdemann <[EMAIL PROTECTED]> wrote: > Ok, so I just noticed that the a55_id field which is the primary key, > was declared as an IntegerField instead of an AutoField which is why > it was showing up on the inline form, but I still can't get any of the > other fields

Passing values to template

2008-11-17 Thread Alex Jonsson
Hey guys, I have a news application that I would like some help with. My view generates a list with objects mixed with dictionaries with two objects. Then in my template, I want to loop through this list and output each value. However, when it encounters a dictionary in the list I want it to

Re: avoid cascade delete

2008-11-17 Thread David Zhou
On Mon, Nov 17, 2008 at 10:46 AM, Randy Barlow <[EMAIL PROTECTED]> wrote: > > On Sun, 16 Nov 2008 23:21:05 -0800 (PST), Merrick <[EMAIL PROTECTED]> > declared: >> I have two models, links and groups. A Link has an optional foreign >> key Group. >> >> When I delete a Group, Django by default

Serializing models to JSON

2008-11-17 Thread srn
Hi, In my application I'm trying to serialize the following model to json: class Node(models.Model): name = models.CharField(db_column="NAME", max_length=30, db_index=True) description = models.CharField(db_column="DESCRIPTION",

Re: avoid cascade delete

2008-11-17 Thread Randy Barlow
On Sun, 16 Nov 2008 23:21:05 -0800 (PST), Merrick <[EMAIL PROTECTED]> declared: > I have two models, links and groups. A Link has an optional foreign > key Group. > > When I delete a Group, Django by default deletes all Links that > referenced the Group that is being deleted. > > How do I avoid

Re: Frustration with custom Inline forms

2008-11-17 Thread Kip Parker
There's a problem with the exclude statements above, you've got tuple- trouble, missing trailing commas: exclude = ('a55_id') should be ('a55_id',) or ['a55_id'] easy mistake, search for "tuple" in this group and you'll see you have company. Kip. On Nov 17, 2:01 pm, Ben Gerdemann <[EMAIL

Re: admin site problem

2008-11-17 Thread Daniel Roseman
On Nov 17, 12:41 pm, Vicky <[EMAIL PROTECTED]> wrote: > I found the problem.. I used : > >                             def __unicode__(self): > > function in my model. so it a can return only sting values. So if i > need to return a column of type integer or contains a foreign key how > should i

Re: Custom form/formset for edit inline

2008-11-17 Thread Ben Gerdemann
I'm having exactly the same problem which I posted about here http://groups.google.com/group/django-users/browse_thread/thread/bb4c792f13b2eceb# Have you figured out how to do this? Yours is the third message I've read by someone trying to customize an inline form without any solution. I'm

Re: admin site problem

2008-11-17 Thread Kip Parker
You need to turn it into a string, this will do it: def __unicode(self): return '%s' % self.integer_column On Nov 17, 12:41 pm, Vicky <[EMAIL PROTECTED]> wrote: > I found the problem.. I used : > >                             def __unicode__(self): > > function in my model. so it a can

Sessions

2008-11-17 Thread srn
Hi, I'm trying to work with the session object in my application but it doesn't work as expected. So in my settings.py I have: MIDDLEWARE_CLASSES = ( 'django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware',

Re: Custom Inline Forms with InlineFormsets

2008-11-17 Thread Ben Gerdemann
I'm having a similar problem that I posted about here: http://groups.google.com/group/django-users/browse_thread/thread/bb4c792f13b2eceb# Did you find a solution that works for you? Sorry, I couldn't figure out from your post exactly what you did. I tried using inlineformset_factory() like you

geodjango importing existing data - pointfields

2008-11-17 Thread Alfonso
I have a legacy database that consists of a number of addresses with pre-geocoded WKT points. I'm trying to import these directly into a GeoDjango setup - postgres db, either by csv or psql csv copy - doesn't matter which. First problem is I get this error 'new row for relation "site_locations"

Re: Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
Ok, so I just noticed that the a55_id field which is the primary key, was declared as an IntegerField instead of an AutoField which is why it was showing up on the inline form, but I still can't get any of the other fields excluded from the inline form so the problem is still there. Also, if it

Is there a place from where I can get the completed code for the Django 4-part tutorial?

2008-11-17 Thread shabda
Is there a place where I can get the app completed as part of http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
I'm trying to customize the inline forms of a model that are displayed when I'm editing it's parent, but I can't get anything to work! Can someone help? First, here are my models: class T22Pais(models.Model): a22_id = models.AutoField(primary_key=True) a22_nome_1 = models.CharField("Nome

Re: admin site problem

2008-11-17 Thread Vicky
I found the problem.. I used : def __unicode__(self): function in my model. so it a can return only sting values. So if i need to return a column of type integer or contains a foreign key how should i do it?? On Nov 17, 4:28 pm, Lars Stavholm <[EMAIL PROTECTED]>

Re: ManyToMany and save method

2008-11-17 Thread Malcolm Tredinnick
On Mon, 2008-11-17 at 12:49 +0100, Marco Minutoli wrote: > I have this model: > > class Ticket(models.Model): > ## ForeignKey > project = models.ForeignKey ( > 'Project', > null=True, > blank=True, > verbose_name="Project", > ) > submitter =

Re: ManyToMany and save method

2008-11-17 Thread Alex Koshelev
Related objects save after `host`. So insertion into M2M table happens after save method of host object has executed. In your example - after `Ticket.save` On Mon, Nov 17, 2008 at 14:49, Marco Minutoli <[EMAIL PROTECTED]>wrote: > > I have this model: > > class Ticket(models.Model): >##

ManyToMany and save method

2008-11-17 Thread Marco Minutoli
I have this model: class Ticket(models.Model): ## ForeignKey project = models.ForeignKey ( 'Project', null=True, blank=True, verbose_name="Project", ) submitter = models.ForeignKey ( User, related_name="submitter",

Re: Setting Up Django on Vista and Creating a Database

2008-11-17 Thread Karen Tracey
On Mon, Nov 17, 2008 at 3:13 AM, John Antony <[EMAIL PROTECTED]> wrote: > > I have currently created a database with the following details: > DATABASE_ENGINE = 'mysql' > DATABASE_NAME = 'myforum' > DATABASE_USER = 'root' > DATABASE_PASSWORD = 'myforum' > DATABASE_HOST = 'localhost' >

Re: admin site problem

2008-11-17 Thread Lars Stavholm
Vicky wrote: > I tried to add some values to my table from admin site. Table has 3 > columns one of integer type and other two of string type. When i tried > to save my entries it giving an error as: > > "coercing to Unicode: need string or buffer, int found" > > How to solve it?

Re: Items tree in Django

2008-11-17 Thread Malcolm Tredinnick
On Mon, 2008-11-17 at 11:46 +0100, Fabio Natali wrote: [...] > The point is, how can I create the root of my tree? Should I add some > "blank=True, null=True" properties to my Node model? So to have: > > class Node(models.Model): > name = models.CharField(max_length=50) > parent =

Re: Items tree in Django

2008-11-17 Thread Fabio Natali
bruno desthuilliers wrote: [...] > > I've been told to use django-treebeard > > That's what I was about to suggest !-) > If you are really confident that your hierarchy will never grow deeper > than three levels, the above solution might be good enough. But it's > still less efficient than the

Re: How to access the request object in a decorator

2008-11-17 Thread bruno desthuilliers
On 17 nov, 10:02, TH <[EMAIL PROTECTED]> wrote: > Hello, > > I wanted to redirect a logged in user if he access certain page. For > example i do not want the user to access registration page if he is > logged in. > > A simple way to do this is: > > def register(request): > if

Re: How to access the request object in a decorator

2008-11-17 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-11-17, o godz. 10:02, przez TH: > I wanted to redirect a logged in user if he access certain page. For > example i do not want the user to access registration page if he is > logged in. > > A simple way to do this is: > > def register(request): >if

Re: Items tree in Django

2008-11-17 Thread bruno desthuilliers
On 17 nov, 11:46, Fabio Natali <[EMAIL PROTECTED]> wrote: > Hi everybody out there! :-) > > I have to cope with a few hundreds item tree/hierarchy in my Django > project. Specifically, I'll have 500 hundreds leaves in a 3-levels > tree with a dozen branches. > > I won't need much writing over

admin site problem

2008-11-17 Thread Vicky
I tried to add some values to my table from admin site. Table has 3 columns one of integer type and other two of string type. When i tried to save my entries it giving an error as: "coercing to Unicode: need string or buffer, int found" How to solve it?

How to access the request object in a decorator

2008-11-17 Thread TH
Hello, I wanted to redirect a logged in user if he access certain page. For example i do not want the user to access registration page if he is logged in. A simple way to do this is: def register(request): if request.user.is_authenticated(): return HttpResponseRedirect('/

Re: unchecked checkboxes not accessed through request.POST['check_name']

2008-11-17 Thread TH
As far as i remember according to the HTML specs the unchecked values are not sent with form post. So you can use some logic in your server side code to deduce the unchecked values. (Since you render them in the first place so may be you have a list of items from database) or if you really want

Items tree in Django

2008-11-17 Thread Fabio Natali
Hi everybody out there! :-) I have to cope with a few hundreds item tree/hierarchy in my Django project. Specifically, I'll have 500 hundreds leaves in a 3-levels tree with a dozen branches. I won't need much writing over this tree, I'll just need to read it and show data in a drop down menu.

Re: Apache Segmentation Fault on succesful authentication

2008-11-17 Thread Graham Dumpleton
Can you try building mod_wsgi instead and see if it picks up the correct library? If it doesn't work, post the output from running 'configure' script and running 'make' for mod_wsgi. I trust mod_wsgi build process more than I do mod_python. Graham On Nov 17, 9:04 pm, huw_at1 <[EMAIL

Re: Apache Segmentation Fault on succesful authentication

2008-11-17 Thread huw_at1
ls -ltr /usr/local/lib/python2.5/config/libpython2.5.so lrwxrwxrwx 1 root root 21 Nov 12 10:48 /usr/local/lib/python2.5/config/ libpython2.5.so -> ../../libpython2.5.so ls -ltr /usr/local/lib -r-xr-xr-x 1 root root 4806649 Nov 11 11:22 libpython2.5.a -r-xr-xr-x 1 root root 4806649 Nov 12

automatically save latitude and longitude of the address.

2008-11-17 Thread please smile
HI All, How can I add automatically latitude and longitude of the physical address. for exp if, fnclatitude('Chennai') returns latitude and longitude of chenai. Please help This is my model (models.py) def fnclatitude(location): key = settings.GOOGLE_KEY output = "csv"

Re: In forms, how add dynamic initial values out of reach for clients?

2008-11-17 Thread dexter
I've already read that and can't get the first one working: instance = Instance(required_field='value') form = InstanceForm(request.POST, instance=instance) new_instance = form.save() In my case, shouldn't it look like this: user = request.user discussion =

Re: Setting Up Django on Vista and Creating a Database

2008-11-17 Thread John Antony
I have currently created a database with the following details: DATABASE_ENGINE = 'mysql' DATABASE_NAME = 'myforum' DATABASE_USER = 'root' DATABASE_PASSWORD = 'myforum' DATABASE_HOST = 'localhost' DATABASE_PORT = '' I used phpMyadmin to create the database I have updated

  1   2   >