IntegrityErrors after Postgres database restore attempt

2009-12-30 Thread Jason
Hi folks-- I recently hosed my django database, & attempted to do a restore using Navicat for Postgresql. Seems like this was not the thing to try, as django now throws these: IntegrityError: duplicate key violates unique constraint "django_content_type_pkey" (for instance, after adding a new

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-30 Thread Russell Keith-Magee
On Thu, Dec 31, 2009 at 12:25 PM, CB wrote: >> In short, you can't (or shouldn't). >> >> What you're asking the database to do is keep a foreign key value that >> is not valid on the database on which it is stored. > > Yes, this is true. > > >> The multi-db branch had checks for

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-30 Thread CB
> In short, you can't (or shouldn't). > > What you're asking the database to do is keep a foreign key value that > is not valid on the database on which it is stored. Yes, this is true. > The multi-db branch had checks for this sort of referential integrity > until just before the merge;

Minneapolis Hackathon Jan. 9 using Django for "Neighborly" tool/site

2009-12-30 Thread Steven Clift
In the Twin Cities? Interested in helping build a tool to connect nearest neighbors online to build community life? For context see: http://pages.e-democracy.org/Neighborly http://pages.e-democracy.org/Hackathon And this invite to our next Hackathon. Cheers, Steven Clift, E-Democracy.org From:

Totally confused on categorized feeds

2009-12-30 Thread neridaj
I've been following along James Bennett's Practical Django Projects and I'm confused on how to render a template with the correct url that maps to the urlconf for categorized feeds. I understand that the url needs to be in the form feeds/categories/audio but how do I build this url in the template

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2009-12-30 Thread Sam Walters
Thanks for the replies. Yes, there is the option of going to raw MySQL. However the project requirements mean i can't use raw SQL. (portability, readability) >From what i can see using django's db API i have to execute the queries 500 times. I am very familiar with the query documentation and i

Re: error in the example

2009-12-30 Thread Łukasz Balcerzak
Hi, Python's parser use indentation to indicate logical blocks. Read more here: http://www.secnetix.de/olli/Python/block_indentation.hawk http://diveintopython.org/getting_to_know_python/indenting_code.html http://docs.python.org/reference/lexical_analysis.html#indentation You have 3 spaces

Re: error in the example

2009-12-30 Thread Doug Blank
On Wed, Dec 30, 2009 at 6:24 PM, gintare wrote: > Hello, > > In short > OS Debian Gnu Linux Lenny > Python 2.5 > Installed Django-1.1.1.tar.gz, > /usr/lib/python-django/Django-1.1.1/docs/intro/tutorial01.txt > > command python manage.py sql polls > gives

error in the example

2009-12-30 Thread gintare
Hello, In short OS Debian Gnu Linux Lenny Python 2.5 Installed Django-1.1.1.tar.gz, /usr/lib/python-django/Django-1.1.1/docs/intro/tutorial01.txt command python manage.py sql polls gives error: IndentationError: unexpected indent in File

How to check this Ajax function's status

2009-12-30 Thread gilbert F.
Hello, Just wonder if somebody can tell me how to check this Ajax function's status in template. Here is what I have. In my views.py there is an Ajax function def ajaxTable_traffic(request, pid, ...): return HttpResponse("cacheHashCallback_traffic"..)

Re: Is it possible to change order of elements in model?

2009-12-30 Thread creecode
Hello ev, On Dec 30, 2:19 pm, ev wrote: > Example: I have a playlist and I want to have a possibility to change > songs order (manually, not by name or raiting). > > This task could be done by adding to the model an integer field (to > remember the order): >

Re: Django Admin Template Directory

2009-12-30 Thread ashbyrich
I have exactly the same problem.. On Nov 3, 1:13 pm, Ludwik Trammer wrote: > > I didn't specify a path. I did an apt-get install on Ubuntu 9.04 > > Than it should be under "/var/lib/python-support/python2.6/django/" > > Ludwik > > PS: "whereis" locates only binary and man

Re: JavaScript function call

2009-12-30 Thread gilbert F.
Great. Thanks Kevin! On Dec 29, 1:28 am, Kevin Renskers wrote: > First of all, in your template include jQuery: > http://ajax.googleapis.com/ajax/ > libs/jquery/1.3/jquery.min.js"> > > Create a new javascript file, and put the following code in it: > > // This is

Is it possible to change order of elements in model?

2009-12-30 Thread ev
Example: I have a playlist and I want to have a possibility to change songs order (manually, not by name or raiting). This task could be done by adding to the model an integer field (to remember the order): ordering=models.IntField() I'd like to know, if there is any feature to realize such a

Re: error haven't set the DATABASE_ENGINE setting

2009-12-30 Thread gintare statkute
Thanks, reinstalled :) gintare On 12/30/09, Ramiro Morales wrote: > On Wed, Dec 30, 2009 at 4:22 PM, gintare wrote: >> Hello, >> >> OS Debian Gnu Linux Lenny >> Python 2.5 >> Installed python-django_1.0.2-1+lenny2_all.deb with K-package  instead >> of  

Re: error haven't set the DATABASE_ENGINE setting

2009-12-30 Thread Ramiro Morales
On Wed, Dec 30, 2009 at 4:22 PM, gintare wrote: > Hello, > > OS Debian Gnu Linux Lenny > Python 2.5 > Installed python-django_1.0.2-1+lenny2_all.deb with K-package  instead > of  Django-1.1.1.tar.gz, > > it was configured according instalation site: >

Re: error haven't set the DATABASE_ENGINE setting

2009-12-30 Thread Peter Herndon
On Dec 30, 2009, at 2:22 PM, gintare wrote: > Hello, > > OS Debian Gnu Linux Lenny > Python 2.5 > Installed python-django_1.0.2-1+lenny2_all.deb with K-package instead > of Django-1.1.1.tar.gz, > > it was configured according instalation site: >

error haven't set the DATABASE_ENGINE setting

2009-12-30 Thread gintare
Hello, OS Debian Gnu Linux Lenny Python 2.5 Installed python-django_1.0.2-1+lenny2_all.deb with K-package instead of Django-1.1.1.tar.gz, it was configured according instalation site: http://docs.djangoproject.com/en/dev/topics/install/#installing-official-release working:/mano/mysite1# ln -s

button for filtering the admin changelist based on callable

2009-12-30 Thread TeenSpirit83
Hi, I have a callable in the modeladmin for an object XX. Now I want to add a tool button (or something clickable) for filtering the changelist displaying only the object having value less than 30. How would you implement somthing like this? Thanks a lot! -- You received this message

button for filtering changelist based on callable

2009-12-30 Thread TeenSpirit83
Hi, I have a callable "" which calculates a value for every object in a model "XX". I want to add a tool button on the changelist for XX that filters the list showing only the objects having this value less than 30. How would you implement such a stuff? Thanks -- You received this

Creating PHP code via template? Ignores PHP code enclosed in print <<

2009-12-30 Thread rmschne
I am trying to include some PHP code in Django template to created PHP file(s) which get executed on the web server when copied across. I'm finding that PHP code that is inside of <

Re: reverse drops the project from the url returned

2009-12-30 Thread Bill Freeman
Since your urlconf is passing "case" as a named (keyword) argument, you (may) have to pass it that way to reverse: ...reverse('case_url', kwargs={'case':case.id})... Bill On Mon, Dec 28, 2009 at 8:22 PM, davathar wrote: > I'm stuck on a "reverse" problem.  The 'case'

Re: Can I remove the django source dir after install?

2009-12-30 Thread Yusuf Mohsinally
Thanks. I will be keeping it on the dev machine. I wanted to remove it from the prod machine. On Wed, Dec 30, 2009 at 7:51 PM, Jirka Vejrazka wrote: >> - download the tar file >> - extract to a dir c:\django-1.1.1 >> - run "python setup.py install" >> >> Can I now

Re: Can I remove the django source dir after install?

2009-12-30 Thread Jirka Vejrazka
> - download the tar file > - extract to a dir c:\django-1.1.1 > - run "python setup.py install" > > Can I now delete the c:\django-1.1.1 dir? (it seems like all the > necessary files have been copied over to the python site library dir. > Or, is there something that I may still need in the

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2009-12-30 Thread Nick Arnett
On Wed, Dec 30, 2009 at 7:15 AM, Adam Playford wrote: > I'm not an expert on this, but a few thoughts. > > First, if I'm reading your message right, it sounds like your problem > probably isn't with the query, but with how many times you're running > it. I'll echo

Re: Reg. creating dynamic db table

2009-12-30 Thread Peter Landry
On 12/30/09 9:58 AM, "Saravanan" wrote: > Waqqas Jabbar, thank you for your answer. This is a simple solution. > By the way, I am inserting few million rows a day. I am accessing this > table from many other application. It is not a Django dedicated table. > I have an

Re: Get name from request.path

2009-12-30 Thread Tim
Perhaps the Sites framework might help achieve this in a more Django- like way. http://docs.djangoproject.com/en/1.1/ref/contrib/sites/ Not sure if you've looked into it before and ruled it out... not entirely sure what you're trying to accomplish. On Dec 28, 12:06 pm,

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2009-12-30 Thread Adam Playford
I'm not an expert on this, but a few thoughts. First, if I'm reading your message right, it sounds like your problem probably isn't with the query, but with how many times you're running it. If you think about it, if it's taking you 12 seconds to run *500* queries, that's actually pretty darn

Re: Reg. creating dynamic db table

2009-12-30 Thread Saravanan
Waqqas Jabbar, thank you for your answer. This is a simple solution. By the way, I am inserting few million rows a day. I am accessing this table from many other application. It is not a Django dedicated table. I have an external database reader with my customized open and close. When I add few

Re: Get name from request.path

2009-12-30 Thread Anton Bessonov
django.core.urlresolvers.resolve? kelvan.mailingl...@gmail.com schrieb: > request.META['HTTP_HOST'] just return the webadress from the server, I > need the name I gave an url un urls.py. > Like reverse just the other way > > florian > > 2009/12/25 Shawn Milochik > > Try

Can I remove the django source dir after install?

2009-12-30 Thread yummy_droid
Hi, I am not all too certain if this will cause side effects... This is what I did to install django: - download the tar file - extract to a dir c:\django-1.1.1 - run "python setup.py install" Can I now delete the c:\django-1.1.1 dir? (it seems like all the necessary files have been copied over

Re: Creating a ISP control panel with Django.

2009-12-30 Thread Larrik Jaerico
I would forget the signals, and override your model's save() function instead. That should give you all of the functionality you are asking for, and be much less of a headache. On Dec 29, 11:11 pm, Marc Aymerich wrote: > Hi everyone, > > I just started developing my first

UNable to log into admin console with the extended auth user model

2009-12-30 Thread avinash
Hi, I've created a custom user class which is inherited from auth user class. I wanted some additional fields for my user model and at the mean time also wanted to use django's default backend so went for inheritence. Here's how my models look like, class CustomUser(User): city =

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-30 Thread Russell Keith-Magee
On Wed, Dec 30, 2009 at 6:13 AM, CB wrote: > Hello. > > I've been developing on the multdb branch for awhile now (most recent > version just before the dropping of the 'using' meta attribute), and > everything has been going well. Recently though, with multidb landing > in the

Re: Storing user's IP while using admin site

2009-12-30 Thread Łukasz Balcerzak
Thanks for that.I'm not sure why I haven't figure this out ;-) After googling around I couldn't find answer for this and just after I had sent previous mail I found following post http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html It has some nice hints about

Re: Storing user's IP while using admin site

2009-12-30 Thread 夏恺
Hi, The best idea I can come up with is to override admin.ModelAdmin's save_model method, which would require only about 10 lines of code and IMHO it's pretty clean. Xia Kai(夏恺) xia...@gmail.com http://blog.xiaket.org --

Storing user's IP while using admin site

2009-12-30 Thread Łukasz Balcerzak
Hi there, I wonder if there is some easy and clean way of achieving this (hooking custom admin views in urls maybe is not that hard but definitely is not clean). Let's assume we have simply model: class Page(models.Model): title = models.CharField(max_length=64) author =

Re: Django Project Management App

2009-12-30 Thread Gour
On Fri, 11 Sep 2009 08:26:02 +0200 >> "Petar" == Petar Radosevic wrote: Hello Petar, Petar> The coincidence is that we just created a invoice/quote admin Petar> application for Django. I'm still writing a blog post about it. Petar> But you can see it here: Petar> Petar>