Re: m2m assignments lost when saving in admin but not shell

2011-08-17 Thread Matt Schinckel
I had similar problems, but I put it down to doing something 'unusual'. Try setting a pdb breakpoint in your admin class, and see if there is anything odd. I found that I was getting failures due to save(commit=False) meaning that an object had no primary key, and I had to do some fancy stuff

m2m assignments lost when saving in admin but not shell

2011-08-17 Thread Shawn Milochik
I have some code that modifies related items when a model is saved. I've tried this by both using a post_save signal and by putting the code directly in a save() override. When I save an instance in the Django admin, it never works. When I save an instance in ./manage.py shell it always works.

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread michael kapelko
I.e. I want to set up database connection after Django app has started *when I want it*. Is there a way to do it? -- 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

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread michael kapelko
Delphi application works with server based scripts over TCP. It can be replaced with web interface. I don't have several databases, I will use single one, it's username/password that I want to use for everything Django does. So essentially I want to only change 'USER', 'PASSWORD' in settings.py

Performance of process_template_response for corporate branding

2011-08-17 Thread Nathan Hoad
I have a project at the moment that requires a lot of corporate branding as well as internationalisation/translations etc. Basically the way the system currently works is that it performs the translations, then applies branding for specific distributors. Now we're developing a web-based front end

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread Mike Dewhirst
On 18/08/2011 11:23am, michael kapelko wrote: I don't think the OP want to select which db is used, but to connect to the db with the logged in user's credentials. Exactly. DB authentication and user authentication are separate things. Users authenticate against Django. Full stop. Django>

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread michael kapelko
> I don't think the OP want to select which db is used, but to connect > to the db with the logged in user's credentials. Exactly. > DB authentication and user authentication are separate things. Users > authenticate against Django. Full stop. Django > accesses the database using > login data

Re: RPC for python functions in a Django project

2011-08-17 Thread Gelonida N
Hi Muhammad, On 08/17/2011 08:18 PM, Muhammad Choudry wrote: > I've > found that JSON-RPC is a good way to go for this, as there is > typically built in support for this in javascript in addition to the > numerous additional benefits. > > I've seen several ways to do this: > 1) Create a unique

Re: Upload Multiple Images App ?

2011-08-17 Thread william ratcliff
We've done this using django and the fileapi--but it will only work with HTML5 and modern browsers...The only other solution I know involves flash (I believe uploadify or swfupload)... Best, William 2011/8/17 枯藤天涯 > to Kevin Monceaux,according to Kevin's offering link,we

problem with a grph image in template

2011-08-17 Thread smartaz
good night and first my excuses for my English!! after several research days I still do not succeed in solving a probleme of billing of a graph generated with matplotlib and pil in another view to be more definite I have a view plot(request) which generates a graph canvas.draw () pil_image =

Re: How to load data from local static path in templates (security error)

2011-08-17 Thread Daniel Roseman
On Wednesday, 17 August 2011 19:00:13 UTC+1, Adam Zedan wrote: > > Hi it seems I cant access data from local static paths such as > c:\\somefolder\somefile.gif in my templates when I enter the url > the code for my template is simplified to something like this > > > > > >

Re: Successfully Running Command Line Application from Django

2011-08-17 Thread octopusgrabbus
Thanks for the answer. It fixed the problem. On Ubuntu it was www-data user and on Red Hat Enterprise 5, it was apache user, who were trying to write in amr's directory. I put each user into amr's group on their respective systems. All is well. On Aug 15, 4:26 pm, wayne

Re: GeoDjango Use

2011-08-17 Thread Ovnicraft
On Wed, Aug 17, 2011 at 1:06 PM, Dan H wrote: > how would I use geodjango to store geographic data in just one table > of my database? can you import it as another app in a django project? > or how would that work? > Geodjango is active by default, you just need inherit

Re: failed to load dll, what happened?

2011-08-17 Thread Andre Terra
Hello, thinke365, First, please read https://code.djangoproject.com/wiki/UsingTheMailingList Try running manage.py from a shell/prompt, not from the IDE. See also http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ Cheers, AT On Wed, Aug 17, 2011 at 2:03 PM,

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread Andre Terra
DB authentication and user authentication are separate things. Users authenticate against Django. Full stop. Django accesses the database using login data you provide on settings.py. If you're talking about permissions, Django ships with a permission module. You can define custom permissions on

Re: GeoDjango Use

2011-08-17 Thread Andre Terra
http://geodjango.org/presentations/ On Wed, Aug 17, 2011 at 3:06 PM, Dan H wrote: > how would I use geodjango to store geographic data in just one table > of my database? can you import it as another app in a django project? > or how would that work? > > -- > You received

Re: need help regard to setup a web-hosting environment for Django

2011-08-17 Thread Andre Terra
*Best Right way to install django, python packages:* http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ *Install nginx and serve django apps through fcgi: *https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/*

need help regard to setup a web-hosting environment for Django

2011-08-17 Thread vikas ruhil
Hey I am using Ubuntu as My OS, hey want to setup a local web-hosting environment on my machine for a open source project for a django website , so please any can help me in this how to setup i know set up a local web hosting of php not for python can anybody help me, I try about 20 times i

RPC for python functions in a Django project

2011-08-17 Thread Muhammad Choudry
Hi, I'm in the middle of trying to create a django website to access data in a MySQL database. The intenion is to also create a UI in Dojo (javascript). Also I would like the django backend will also provide webservices (RPC for python functions) to allow access to the MySQL database remotely.

GeoDjango Use

2011-08-17 Thread Dan H
how would I use geodjango to store geographic data in just one table of my database? can you import it as another app in a django project? or how would that work? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Template html works when double clicked but empty when accessed through server

2011-08-17 Thread Adam Zedan
Are ou saying that the reason i get nothing when running through a url is that because of security reasons (i.e) loading data from local machine ?? if so could you tell me how i could solve that problem ?? On Tue, Aug 16, 2011 at 4:43 PM, Konstantin Sushenko wrote: > you do not

failed to load dll, what happened?

2011-08-17 Thread thinke365
i have created a django project using pydev, then i run manage.py, then error info such as failed to load dll comes out, what's wrong? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread bruno desthuilliers
On 17 août, 18:37, Tom Evans wrote: > On Wed, Aug 17, 2011 at 5:27 PM, michael kapelko wrote: > > Still, how do i make all my models use the connection info logged in > > user provided? > > You can't, or at least not with stock django. The term you

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread Tom Evans
On Wed, Aug 17, 2011 at 5:27 PM, michael kapelko wrote: > Still, how do i make all my models use the connection info logged in > user provided? > You can't, or at least not with stock django. The term you are looking for is 'multi tenancy', where by the database used is

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread michael kapelko
Still, how do i make all my models use the connection info logged in user provided? -- 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 email

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread Shawn Milochik
It's just Python. Use the sqlite3 module or psycopg2 (or whatever's appropriate) and use your databases as you like. There's nothing stopping you from using any tables in whatever database Django's models are using, or any other databases of any kind from within your Python code. There's no

How do I select which user/password to use for DB connection after Django app was started?

2011-08-17 Thread michael kapelko
Hi. I want to have a login form, and connect to DB with the provided username/password. Django's settings.py specifies username/password/DB to use for the whole Django app. I want to defer the DB connection when a user actually logins, not when Django starts up. Is there a way to do it? Thanks.

Re: Cascading Deletes on ManyToManyField

2011-08-17 Thread ollie
class Item(models.Model): tags = models.ManyToManyField(Tag, through=Tagging) ... class Tag(models.Model): ... class Tagging(models.Model): item = models.ForeignKey(Item) tag = models.ForeignKey(Tag) ... tagging = Tagging.objects.get(item=item1, tag=tag1)

Re: Cascading Deletes on ManyToManyField

2011-08-17 Thread Jacob Kaplan-Moss
On Wed, Aug 17, 2011 at 6:12 AM, Jeremy Keeshin wrote: > I have an Item model that has many Tags. If I delete a Tag, I want to make > sure the related Items are not deleted. I tested this out on my local > database, and it seems that there are no cascading deletes with many to

Cascading Deletes on ManyToManyField

2011-08-17 Thread Jeremy Keeshin
I have an Item model that has many Tags. If I delete a Tag, I want to make sure the related Items are not deleted. I tested this out on my local database, and it seems that there are no cascading deletes with many to many fields. However, I previously deleted data accidentally with ForeignKeys

Re: formfield_for_foreignkey field.name-generic

2011-08-17 Thread Tom Evans
On Wed, Aug 17, 2011 at 8:54 AM, andrepar wrote: > How can apply DRY to the following lines? > > def formfield_for_foreignkey(self, db_field, request, **kwargs): >        if db_field.name == "field1": >            kwargs["queryset"] = >

Re: How to display Scientific Notation for a field on the admin pages?

2011-08-17 Thread 枯藤天涯
I think you can add a method in the class .when you want to display the scientific notation on the admin pages ,just call the instance.method.and that is ok. 2011/8/5 Jeremy Dunck : > On Tue, Aug 2, 2011 at 12:32 PM, DjangoOfWar wrote: >> Right now I have

Re: Djangonaut is looking for a job

2011-08-17 Thread 枯藤天涯
hello,I am from China。And I am looking a job about python/django .Just same as you .Remote (telecommuting) only.Can we find the job like this? 2011/8/5 Eugeny Belykh : > Hi everybody.I am Django newbee based in Russia. I am looking for a > Django related job.Remote

Re: How to make Django not prefix columns with table name?

2011-08-17 Thread bruno desthuilliers
On 17 août, 09:57, kornerr wrote: > Hi. > I use oracle django backend, and access foreign scheme tables. The > prefixing invalidates my queries. > How can the prefixing be turned off? https://docs.djangoproject.com/en/1.3/ref/models/options/#db-table You may be interested in

Re: Upload Multiple Images App ?

2011-08-17 Thread 枯藤天涯
to Kevin Monceaux,according to  Kevin's offering link,we must delete the underline file by ourselves,django is no longer doing this for us.I think you can write your own code to delete the files which is local our your computer.And this is easy.By the way,this posy is very useful.It mentions

How to make Django not prefix columns with table name?

2011-08-17 Thread kornerr
Hi. I use oracle django backend, and access foreign scheme tables. The prefixing invalidates my queries. How can the prefixing be turned off? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

formfield_for_foreignkey field.name-generic

2011-08-17 Thread andrepar
How can apply DRY to the following lines? def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == "field1": kwargs["queryset"] = Field1.objects.filter(owner=request.user) return super(MyModelAdmin,

formfield_for_foreignkey

2011-08-17 Thread andrepar
def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == "field1": kwargs["queryset"] = Field1.objects.filter(owner=request.user) return super(MyModelAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs) if db_field.name ==

Re: How to Layout a Django Application?

2011-08-17 Thread Andre Lopes
Obrigado André(Thank you André), I have read about the templates. Seems easy. Continue with the learning... Regards, On Tue, Aug 16, 2011 at 2:04 PM, Andre Terra wrote: > There are no particular layouts, but sometimes writing an inclusion tag[1] > can help with

Problem with translations

2011-08-17 Thread Isaac
Hi folks, I'm having a problem with a single module and its translations. This module has some lazy translation (the same as other modules), but in admin, it spreads an error. Error is the following: TemplateSyntaxError at /admin/tieredpricing/pricingtier/add/ Caught TypeError while

Re: 3rd party Apps in Django

2011-08-17 Thread Derek
Chris "Dingo" projects? Is that what they call them in Australia ;) On Aug 16, 12:54 am, Chris Lawlor wrote: > +1 for using virtualenv. Indispensable for working on more than one dingo > project on the same development machine. If you're developing on Linux or > Mac,