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, > > I'm not sure off th

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 - @d0

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 regular-title is an invalid variable

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 will get displayed in >

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 deployment documentation, a

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 workin

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 availabl

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 examp

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 "D

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 i

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 some

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/ 2009/5

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 c

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 c

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 = models.CharField(max_length=63) >  

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 --~--~-~--~~~---~--~~ You received

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 try > > ahh one thing

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 athttp://code.google.com/p/django-mptt/it > would help you a lot. > > -- > Antoni Alo

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 th

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 pubs_by_town(requ

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. -- Antoni Aloy López Blog: ht

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 > > mptt will give you lots of extra messages

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, order_insertion_by=['n

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 django

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/ >S3.py > > in settings

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: http://www.nabble.com/List-users-that-are-currently-lo

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. http://groups.google.com/group/django-users/browse_

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 was

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. --~--~-~--~~

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 = models.On

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 (based on a town slug in the >

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 manage that via Dja

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 a

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 me

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 check

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): n

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. *n

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 the

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 is when I use a picture ta

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 t

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. > > -- > George Thank you for the

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 associated with one application > > only, for examp

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: 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 "Cannot identify image file" - but there is > > o

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 I'

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 the maintenance of th

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 1

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 f

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 dire

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 > > anything that is at a higher level

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 interf

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 ar

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 a request, not a res

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 option is Green, as in '

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): >     ... ( street, city, e

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 having the same problem. >

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, decima

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 Dec

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)

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 d

Re: Problem with prepopulating model form.

2009-05-10 Thread zayatzz
This thread has slipped into inactivity, but perhaps there is someone, who can clear this thing for me. Additionally... with form = articleForm(instance=i) it does insert new article into database instead of updating old one... Alan. On May 9, 10:27 pm, zayatzz wrote: > Thanks for the advice-

Re: Trouble Starting Up with runserver

2009-05-10 Thread Chris DPS
ping localhost seemed fine, 4 sent and 4 received, 0ms, 0% loss I have tried 127.0.0.1:8000, :8000, 0.0.0.0:8000, 127.0.0.1:others On May 10, 9:52 pm, Addy Yeow wrote: > What does 'ping localhost' in command-prompt tells you?Did you try 'python > manage.py runserver 127.0.0.1:8000'? Or 'python

Re: django decimal field query issue

2009-05-10 Thread jai
Thanks for your reply. We are already using geodjango for latitude and longitude manipulation. But i want to store decimal (float) data, for that purpose i selected 'DecimalField'. But the actual problem is when ever i tried to execute the below query, it always fails "Vehicle=Vehicl

Re: autofilling select boxes

2009-05-10 Thread jai
You can use Dojo or jquerry. On May 11, 10:44 am, newbie wrote: > 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 po

adding columns to a many to many

2009-05-10 Thread mickey
Hi So i have something like t his in my model: article = models.ManyToManyField(Publication) But i'd like to add a few additoinal columns like date_published on the generated many to many table, how do i do that? Thanks. --~--~-~--~~~---~--~~ You received this

ajax cascading select boxes

2009-05-10 Thread newbie
Hi, I'm a newbie to Django. I have a form which has some attributes to be filled by the user viz., name, age, address etc. I want to get the address of the user by just allowing him making the selections rather than letting him fill it. I'm planning to give him a select box for stat

Re: ajax cascading select boxes

2009-05-10 Thread google torp
So CustomUser and UserDetails is a model you made for your users? If that is the case, you probably want to hook use a modelform instead is it makes things a bit eaiser. Anyways in your view, the user just pops out of the blue. My guess is that you need to do something like user = CustomUser(...