autofilling select boxes

2009-05-10 Thread newbie
Hi, I'm new to django and also ajax. I want to create a form which has a select box and based on the selection made, the options of another select box are generated. I've achieved this task in web2py but i'm porting my application into django and cudnt find a good start using ajax in

Re: How to disable deletion af a model instance

2009-05-10 Thread Praveen
Hi, i do not know how its going to achieve but in my case. For each payment entry i will add delete button and will disable the default django admin interface. Create a separate GroupProfile class class GroupProfile(models.Model): name = models.CharField(_('name'), max_length=80, unique=True)

Re: django decimal field query issue

2009-05-10 Thread Will Hardy
Firstly, I would very seriously recommend using geodjango for anything that deals with longitude and latitude. I would also recommend using IntegerField if your decimal_places is going to be 0. As for you question, I have no idea why it wouldn't work. There seems to be a space in your failing

django decimal field query issue

2009-05-10 Thread jai_python
Hie, I have a problem in django decimal field query execution. Here i have explained clearly about my problem. Model Class VehicleLocation: simno = models.DecimalField(max_digits=10, decimal_places=0) latitude = models.DecimalField(max_digits=25,

Re: Trouble Starting Up with runserver

2009-05-10 Thread Addy Yeow
What does 'ping localhost' in command-prompt tells you?Did you try 'python manage.py runserver 127.0.0.1:8000'? Or 'python manage.py runserver :8000' - Addy On Mon, May 11, 2009 at 12:40 PM, Chris DPS wrote: > > So I've definitely shut off all Firewalls. > It still is

Re: OneToOneField, and inlines

2009-05-10 Thread nbv4
On May 10, 4:03 pm, Tom von Schwerdtner wrote: > Greetings folks, I've been wrestling with this and I really don't know > what I'm not doing right, so here is where I am: > > In basic pseudocode, I have: > > models.py: > --- > class Address(models.Model): >    

Re: Trouble Starting Up with runserver

2009-05-10 Thread Chris DPS
So I've definitely shut off all Firewalls. It still is having the same problem. HELP!!! PLEASE On May 10, 6:37 pm, Chris DPS wrote: > How to tell if I have a Firewall running? > I have turned off Windows firewall. When I go to the Windows Security > Center, the Firewall

Re: Accessing value of a Form.Field in templates

2009-05-10 Thread George Song
On 5/10/2009 5:32 PM, Martin wrote: > > On 11 Mai, 02:07, George Song wrote: >> The ticket doesn't appear to be what you're asking for. I think the >> easiest way is for you to insert an extra context variable in your view, >> since `GET` and `POST` are verbs associated with

Recursive ManyToMany?

2009-05-10 Thread nek4life
I'm trying to create a record label website and I'm modeling the music data. I have artists, albums, tracks so far. What I'd like to do is use the artists model for both individual recording artists and groups of recording artists. I'd like to be able to find any singular artist or groups of

Re: Django installation

2009-05-10 Thread Margie
At http://www.djangoproject.com/download/, Option 2 is actually the 1.1 Beta (which does not require subversion). I've been using that for some time and I find that the additions that have been made to the admin interface are really very nice. For example, you can edit fields in the admin

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-05-10 Thread zweb
Hi, I am also looking at Qooxdoo. What has been your experience so far? Will it integrate with Django templates and views? On Apr 8, 2:19 pm, Raymond Cote wrote: > Rob Madole wrote: > > The reason I'm posting is to ask the community if they have know of > >

Re: Wait for file upload to complete?

2009-05-10 Thread tm
Some strange behavior I found while researching this: If I set the django temp directory FILE_UPLOAD_TEMP_DIR to the same directory that I want to upload the file to, the file using 'destination.write(chunk) actually gets saved out faster than the temp file that django is writing to the same

Re: Django installation

2009-05-10 Thread Wayne Koorts
Hi, > As I have read the instruction they need me to download django 1.0.2 > for option 1 and option 2 it required subversion of django. I would > like to ask the group that can I just take the option 1 and no need to > take the second option or not? if not please tell me what is option 2 > use

Django installation

2009-05-10 Thread veasna.phal
Dear Django group, I am the first developer to start with django and my first problem is to install it. As I have read the instruction they need me to download django 1.0.2 for option 1 and option 2 it required subversion of django. I would like to ask the group that can I just take the option

Re: suggestion on querying external database

2009-05-10 Thread Karen Tracey
On Sun, May 10, 2009 at 8:45 PM, tekion wrote: > > Yes. I saw this link. My impression on first read is that it imports > the database into Django's database. I am not looking for this. I am > looking to just be able to read in the data from the external database > and leave

Re: Trouble Starting Up with runserver

2009-05-10 Thread Chris DPS
How to tell if I have a Firewall running? I have turned off Windows firewall. When I go to the Windows Security Center, the Firewall option is Green, as in 'on'. I looked for normal firewall products on my computer such as Symantec and couldn't find any active ones. How can find which firewall

Re: Error: "Cannot identify image file" PIL + Django

2009-05-10 Thread Jacolyte
On May 10, 6:07 pm, Karen Tracey wrote: > 2009/5/10 Jacolyte > > > > > > > I have a model that has an ImageField, and when I try to work with > > this model in the admin interface by uploading an image of any type, I > > usually receive the error

Re: suggestion on querying external database

2009-05-10 Thread tekion
Yes. I saw this link. My impression on first read is that it imports the database into Django's database. I am not looking for this. I am looking to just be able to read in the data from the external database and leave the maintenance of the database to the external application. Has anyone done

Re: multiple application under a project and handling of tables

2009-05-10 Thread tekion
Cool. Thanks. This is what I am looking for. On May 10, 5:05 pm, Daniel Roseman wrote: > On May 10, 10:02 pm, tekion wrote: > > > Hi, > > Given a scenarios where you have multiple applications under a > > project.  You want to manage tables

Re: Accessing value of a Form.Field in templates

2009-05-10 Thread Martin
On 11 Mai, 02:07, George Song wrote: > > The ticket doesn't appear to be what you're asking for. I think the > easiest way is for you to insert an extra context variable in your view, > since `GET` and `POST` are verbs associated with a request, not a response. > > -- >

Re: Accessing value of a Form.Field in templates

2009-05-10 Thread George Song
On 5/10/2009 4:27 PM, Martin wrote: > Hi, > > I'm trying to check in a template if the form on this page was sent or > not (in other words if the page was accessed by POST or GET). Is there > a build-in way to do something like that down on the template. Or do I > have to add a extra 'flag' for

Re: Error: "Cannot identify image file" PIL + Django

2009-05-10 Thread Karen Tracey
2009/5/10 Jacolyte > > I have a model that has an ImageField, and when I try to work with > this model in the admin interface by uploading an image of any type, I > usually receive the error "Cannot identify image file" - but there is > only one exception to this, which

Re: Field value from queryset as extra_context

2009-05-10 Thread George Song
On 5/10/2009 8:03 AM, Jamie Pittock wrote: > Please excuse the subject if it makes no sense. > > Simplified, I have two models Pub and Town. Pub has a ForeignKey > field called 'town'. I'm using the generic object_list view to > display all pubs in a particular town (based on a town slug in

Error: "Cannot identify image file" PIL + Django

2009-05-10 Thread Jacolyte
I have a model that has an ImageField, and when I try to work with this model in the admin interface by uploading an image of any type, I usually receive the error "Cannot identify image file" - but there is only one exception to this, which is when I use a picture taken from my digital camera.

inline within an inline -OR- __unicode__ for intermediary models

2009-05-10 Thread nbv4
I have one model that looks like this: class Position(models.Model): base = models.ManyToManyField("Base", through="PosBase", blank=True) [...] class PosBase(models.Model): position = models.ForeignKey("Position") base = models.ForeignKey("Base") class Base(models.Model):

Re: User Authentication Woes

2009-05-10 Thread George Song
On 5/10/2009 5:38 AM, Alfonso wrote: > Hi, > > App I'm currently working on can be accessed by either authorised > admin users or authenticated customers (one customer might have a > number of users on their account). A non-admin user can login and > view restricted sections of the site to

Accessing value of a Form.Field in templates

2009-05-10 Thread Martin
Hi, I'm trying to check in a template if the form on this page was sent or not (in other words if the page was accessed by POST or GET). Is there a build-in way to do something like that down on the template. Or do I have to add a extra 'flag' for this in my view? Another possible solution for

Wait for file upload to complete?

2009-05-10 Thread tm
Does anyone know how to wait for a file upload to finish? I do this section of code like the docs: def handle_uploaded_file(f): ... for chunk in f.chunks(): destination.write(chunk) ex_function() but while a large file is writing out the code continues

Re: multiple application under a project and handling of tables

2009-05-10 Thread Daniel Roseman
On May 10, 10:02 pm, tekion wrote: > Hi, > Given a scenarios where you have multiple applications under a > project.  You want to manage tables associated with one application > only, for example deleting data in tables associated with one > application only. Is there a way to

Re: Field value from queryset as extra_context

2009-05-10 Thread Daniel Roseman
On May 10, 5:03 pm, Jamie Pittock wrote: > Please excuse the subject if it makes no sense. > > Simplified, I have two models Pub and Town.  Pub has a ForeignKey > field called 'town'.  I'm using the generic object_list view to > display all pubs in a particular town

OneToOneField, and inlines

2009-05-10 Thread Tom von Schwerdtner
Greetings folks, I've been wrestling with this and I really don't know what I'm not doing right, so here is where I am: In basic pseudocode, I have: models.py: --- class Address(models.Model): ... ( street, city, etc) class Contact(models.Model): ... address =

multiple application under a project and handling of tables

2009-05-10 Thread tekion
Hi, Given a scenarios where you have multiple applications under a project. You want to manage tables associated with one application only, for example deleting data in tables associated with one application only. Is there a way to manage that via Django? Thanks.

Re: "-" in template variables

2009-05-10 Thread Danne
Yeah, that could have been a greate solution :) The problem is that there is a huge amount of key-value sets to replace, and i don't want to replace "-" in the blog posts (Tumblr is a blogging service). That would result in a pretty complex regular expression. What I did instead to solve this

Re: List users that are currently logged in

2009-05-10 Thread Addy Yeow
:) I was about to ask the exact same question. A quick Google, I found this 1.

List users that are currently logged in

2009-05-10 Thread jd20878
I am trying to list all users that are currently logged in. I am having trouble getting this right. I have been playing around with sessions but am afraid that I'm running down the wrong path. Any ideas? -- View this message in context:

Re: Django-storages S3 setup

2009-05-10 Thread Karen Tracey
On Sun, May 10, 2009 at 12:14 PM, Dan Jewett wrote: > > Having trouble getting files in the correct locations apparently. > > Here's one example of the setups I've tried: > > /Project/ >/backends/ >S3Storage.py >/App/ >settings.py > > /site-packages/ >

Django-storages S3 setup

2009-05-10 Thread Dan Jewett
Having trouble getting files in the correct locations apparently. Here's one example of the setups I've tried: /Project/ /backends/ S3Storage.py /App/ settings.py /site-packages/ S3.py in settings.py: DEFAULT_FILE_STORAGE = 'backends.S3Storage.S3Storage' >>>from

Re: Category list in Django

2009-05-10 Thread Bro
I use this sample code : from django.db import models import mptt class Genre(models.Model): name = models.CharField(max_length=50, unique=True) parent = models.ForeignKey('self', null=True, blank=True, related_name='children') mptt.register(Genre,

Re: Category list in Django

2009-05-10 Thread Bro
Thanks :) On 10 mai, 17:15, Antoni Aloy wrote: > 2009/5/10 Bro : > > > Thanks, I try to use django-mptt. > > I've installed it but how do you use it ? > > You have the documentation at: > > http://django-mptt.googlecode.com/svn/trunk/docs/models.txt

Re: Category list in Django

2009-05-10 Thread Antoni Aloy
2009/5/10 Bro : > > Thanks, I try to use django-mptt. > I've installed it but how do you use it ? > You have the documentation at: http://django-mptt.googlecode.com/svn/trunk/docs/models.txt mptt will give you lots of extra messages to deal with the category tree. --

Field value from queryset as extra_context

2009-05-10 Thread Jamie Pittock
Please excuse the subject if it makes no sense. Simplified, I have two models Pub and Town. Pub has a ForeignKey field called 'town'. I'm using the generic object_list view to display all pubs in a particular town (based on a town slug in the url). Something like this... def

get next/previous for IntegerField

2009-05-10 Thread Sydney Weidman
I have a model that requires browsing previous and next records by a user-supplied integer value. What is the best way to handle this type of requirement? I suppose I could do a query that looked up records with a value less/greater than the current value with a LIMIT 1 clause or something like

Re: Category list in Django

2009-05-10 Thread Bro
Thanks, I try to use django-mptt. I've installed it but how do you use it ? On 10 mai, 16:15, Antoni Aloy wrote: > 2009/5/10 Bro : > > > How to create a correct Tree of category ? > > Take a look at django-mptt

Re: ModelForm customizing

2009-05-10 Thread Julián C . Pérez
anyone?? any help?? :) > hi all > something like this had already been > reported:http://code.djangoproject.com/ticket/6138 > > i tried sean's solutions but nothing happens... > stand by... > ;) > > On May 8, 7:25 pm, Julián C. Pérez wrote: > > > thank you,s ean > > i will

Re: Category list in Django

2009-05-10 Thread Antoni Aloy
2009/5/10 Bro : > > How to create a correct Tree of category ? > Take a look at django-mptt at http://code.google.com/p/django-mptt/ it would help you a lot. -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net

Re: Category list in Django

2009-05-10 Thread Bro
How to create a correct Tree of category ? On 10 mai, 15:51, Bro wrote: > I want to create a list of category with subcategory. > Here is the class : > > class Category(models.Model): >     parent = models.ForeignKey('self', blank=True, null=True) >     name =

Category list in Django

2009-05-10 Thread Bro
I want to create a list of category with subcategory. Here is the class : class Category(models.Model): parent = models.ForeignKey('self', blank=True, null=True) name = models.CharField(max_length=63) child_list = [] def __unicode__(self): return self.name I use this to

Category list in Django

2009-05-10 Thread Bro
I want to create a list of category with subcategory. Here is the class : class Category(models.Model): parent = models.ForeignKey('self', blank=True, null=True) name = models.CharField(max_length=63) child_list = [] def __unicode__(self): return self.name I use this to

Re: suggestion on querying external database

2009-05-10 Thread Dougal Matthews
This might be useful; http://docs.djangoproject.com/en/dev/howto/legacy-databases/ It describes how to create models for your existing databases. However, it wont stop you being able to make writes with the django ORM. Dougal --- Dougal Matthews - @d0ugal http://www.dougalmatthews.com/

suggestion on querying external database

2009-05-10 Thread tekion
Hi, I have an application which update MySQL database. It has aproximately 5 million rows. I am new to django, I am thinking of using django to generate report using the database as the data source. >From what I have seen of the tutorial, you create a model. The database model, would create

Re: Overwrite send_mail

2009-05-10 Thread Dougal Matthews
Thanks Will, Found it here; http://code.djangoproject.com/browser/django/trunk/django/test/utils.py#L50 That does look about what I am hoping to do, not so sure about monkey patching the core though. Basically, assuming django's send_mail is the standard most apps use, I want to be able to hook

Re: Overwrite send_mail

2009-05-10 Thread Will Hardy
The test runner does something similar if I remember correctly, have a look in django.test.utils and see if you can make something useful out of that. Cheers, Will --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

User Authentication Woes

2009-05-10 Thread Alfonso
Hi, App I'm currently working on can be accessed by either authorised admin users or authenticated customers (one customer might have a number of users on their account). A non-admin user can login and view restricted sections of the site to check stuff like invoices, orders etc. So as an

Re: Overwrite send_mail

2009-05-10 Thread mark hellewell
Hi, The django-mailer app I've been using simply defines a send_mail function with the same signature as the one from django.core.mail. With the 'mailer' app in your INSTALLED_APPS you can then just do something like this at the top of your views.py etc: # use django-mailer app if it's

Re: Model Formsets.save(commit=False) behaviour

2009-05-10 Thread goran
Thanks, I think that it is saving the object twice because when I put a debug print statement like print "Object Saved" in the model's save method, it prints this twice when the code is executed. However, I did go back to it and did an SVN update on django (to 10731), now it appears to be

Re: 'base' template

2009-05-10 Thread Daniel Roseman
On May 10, 1:14 am, lisa holper wrote: > No, sorry there is a misunderstanding. I did not use Apache, but just copied > the html files in my directory of my homepage. So, this does not work? Do I > need to use Apache? > thanks again, Lisa > Again, you need to read the

Re: How to solve value error

2009-05-10 Thread Daniel Roseman
On May 10, 4:17 am, Nalini wrote: > Hi, > > I am getting this value error in my report. i am using pagination fro > my report. I have only 2 records in my database. so in order to check > whether my pagination works i gave > { % autopaginate Data 1 % } so that each record

Re: "-" in template variables

2009-05-10 Thread Daniel Roseman
On May 10, 1:58 am, Danne wrote: > I'm using the Tumblr (http://www.tumblr.com) REST Api, and keys in > returned json contains the character "-", like "post": {"regular- > title": "asdf" .}. I'm having trouble printing this in the django > templates since

Re: "-" in template variables

2009-05-10 Thread Dougal Matthews
>From the docs; "Variable names must consist of any letter (A-Z), any digit (0-9), an underscore or a dot." http://docs.djangoproject.com/en/dev/ref/templates/api/#rendering-a-context I suppose you could write a template tag to handle it or something. Not sure. Dougal --- Dougal Matthews -

Re: simpletag to accumulate media without duplicates

2009-05-10 Thread Margie
Yes, I bet you are right. I think I have to use a "non simple" tag, the kind where I write the parser and renderer. I think I did that a while back, will go off and search my old code. Thanks for the pointer. Margie On May 9, 9:39 pm, Dan Mallinger wrote: > Hi Margie,

Re: Model Formsets.save(commit=False) behaviour

2009-05-10 Thread Margie
I've used that a lot and never had a problem. I'd recommend stepping through the code. When you call save, you go into the save() function in django/forms/models.py, which immediatey takes you into the save_Instance() method. That code is quite straight forward. At the bottom it just looks at