Re: 1.3x-3x Model Instantiation Optimization

2008-01-30 Thread Eren Türkay
On 30 Jan 2008 Wed 03:08:02 Ivan Illarionov wrote: > And, be careful, the code is experimental, untested and relies on deep > black magic of object.__new__(class) which creates the instance > without calling __init__ Hm, a code running fast is really good but this solution seems to be really exp

Re: TypeError on forms.ChoiceField

2008-01-30 Thread Eren Türkay
On 30 Jan 2008 Wed 05:49:28 Patrick J. Anderson wrote: > How can I inject a subset of related photoalbums into this form? I don't know much about iteration of models, but in traditional ways, you can create "choices" tuple from "PhotoAlbum" instance. --~--~-~--~~~--

Re: Having problem using the Syndication Feed Framework

2008-01-30 Thread Matt Davies
Hi Jeff This error NoneType' object has no attribute 'startswith' Usually means that you have got a NoneType obejct back from the database, and you can't very well ask what it starts with, computer says no. If I were you I'd spare an hour and go through the two screencasts on this page with Mic

Re: 1.3x-3x Model Instantiation Optimization

2008-01-30 Thread Jarek Zgoda
Ivan Illarionov napisał(a): > You may add this code to your Django model class and then instead of > obj = YourModelClass(title='Title', , > pub_date=datetime.datetime.now() ) > use > row = (None, 'Title',..., datetime.datetime.now()) > obj = YourModelClass.fromtuple(row) # 1.3x faster then b

Re: dynamic tag count

2008-01-30 Thread Alex Koshelev
for tag in tag_list: for model in [ 'weblog', 'article', 'project' ]: print getattr( tag, model ).count() On 30 янв, 09:22, Chris <[EMAIL PROTECTED]> wrote: > Hello I have a Tagging app that I have created which could have a m2m > relation with several other applications suchas a webl

Re: dynamic tag count

2008-01-30 Thread Daniel Roseman
You should be able to use the standard Python getattr call: print getattr(tag, 'model_name').count() which dynamically gets an attribute passed as a string. -- Daniel. On 30 Jan, 06:22, Chris <[EMAIL PROTECTED]> wrote: > Hello I have a Tagging app that I have created which could have a m2m > re

Re: Apache Subdirectories and Urls

2008-01-30 Thread Graham Dumpleton
On Jan 30, 3:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've been beating my head against this problem for a while now, and I > apologize if I'm asking again (I did look, believe it or not). > > I'm working on a development laptop, and I've got Django working on my > apache server.

Re: Unittest test-database not empty

2008-01-30 Thread rock
I have no fixtures/initial_data-files anywhere in my project tree! Actually, the only file named "initial_data" on my system is djtrunk/ tests/modeltests/fixtures/fixtures/initial_data.json. And that file doesn't contain much. The "ghost-users" only show up when I'm running "./manage.py test". Wh

Re: We're having an extremely difficult to diagnose problem:

2008-01-30 Thread super
On 30 jan, 01:06, Noah <[EMAIL PROTECTED]> wrote: > We're having an extremely difficult to diagnose problem: > > At some point (possibly due to access from the public to a particular > view) our server will crap out. > All 21 Django sites hosted on it will display a very similar error. > There are

language settings

2008-01-30 Thread super
Hello, I've made a site where I use language settings. The problem I have: I have the following code {% ifequal request.LANGUAGE_CODE "nl" %} do this {% endifequal %} On some browsers this works on other browser this does not work as {{ request.LANGUAGE_CODE }} gives "nl-be" To make sure the

ordering help

2008-01-30 Thread leahy_rich
Hi Guys I have a database that stores unit numbers in postgresql eg 3B , 2, 5 , 4C, 1 etc.. so it had to be string type for the letters but now i want to order them in ascending order on the template eg. 1, 2, 3b etc.. The problem is in my view function def summary(request): unit_list = U

Re: 1.3x-3x Model Instantiation Optimization

2008-01-30 Thread Ivan Illarionov
> Hm, a code running fast is really good but this solution seems to be really > experimental and hard-to-use, as well as making code kinda unreadable. It > would be great if it's implemented in next django releases to make django > fast :). Is it possible to do it? It depends on Django developers

database performance problem

2008-01-30 Thread [EMAIL PROTECTED]
I'm developing a time-tracking app, and I've run into some performance issues.. In my models I have that a Project (e.g. "customer A, research") can be a member of a ProjectCategory (e.g. "customer A"), and that each work-unit (Checkin) includes who worked, when they started, when they stopped and

Re: database performance problem

2008-01-30 Thread Thomas Guettler
> def markable(checkins, project_category): > projects = project_category.projects.all() > res = [] > for day in checkins.group_dates(): > for ci in day: # for every checkin that day > if ci.project in projects: # <-- HERE > res.append(day.date) >

run multiple django app's on server

2008-01-30 Thread [EMAIL PROTECTED]
Hello Django Users, I'm working on a application that evolves over time. in order to show both applications we set up virtual hosts in the httpd.conf in the following way. ServerName bioinf-dev.erasmusmc.nl DocumentRoot "/home/bioinf/richard/public_html/iqc" ErrorLog logs/iqc_error_log

Re: run multiple django app's on server

2008-01-30 Thread web-junkie
I have kinda the same problem as of today. It just seems to not use use the settings file I want. Is there something wrong with having to exact same virtualhosts that just differ in the specified django settings? On Jan 30, 2:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello Django Us

Re: run multiple django app's on server

2008-01-30 Thread [EMAIL PROTECTED]
That's the weird thing, If we restart httpd.conf the python code will be compiled in some cases it will show one of the projects for both ports and in a other case it will show the other for both ports without altering anything to the code. Both are working fine independently. So to me it seems t

Re: run multiple django app's on server

2008-01-30 Thread Jonathan Ballet
[EMAIL PROTECTED] wrote: > That's the weird thing, > > If we restart httpd.conf the python code will be compiled in some > cases it will show one of the projects for both ports and in a other > case it will show the other for both ports without altering anything > to the code. Both are working fi

Re: run multiple django app's on server

2008-01-30 Thread [EMAIL PROTECTED]
Thanks for all the advices, i indeed forgot to define the PythonInterpreter. It seems all the problems are fixed by adding this in the httpd.conf. thanks again, Richard On Jan 30, 3:32 pm, Jonathan Ballet <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > That's the weird thing, > > > I

Re: run multiple django app's on server

2008-01-30 Thread Eren Türkay
On 30 Jan 2008 Wed 15:18:21 [EMAIL PROTECTED] wrote: > Did we specified the Httpd.conf in the wrong way ? > Is there someone that experienced similar problems and know how to > solve this ? Did you control that you properly set setting.py file for both sites? It seems to me that there is somethi

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread Mark Green
On Tue, 2008-01-29 at 23:33 -0600, James Bennett wrote: > On Jan 29, 2008 11:18 PM, Mark Green <[EMAIL PROTECTED]> wrote: > > I agree on the loadbalancer front but the overhead for all > > those TCP connections (and pgpool managing them) worries me a bit. > > I've used pgpool in production with g

Re: TypeError on forms.ChoiceField

2008-01-30 Thread Patrick J. Anderson
On Wed, 30 Jan 2008 10:30:04 +0200, Eren T�rkay wrote: > On 30 Jan 2008 Wed 05:49:28 Patrick J. Anderson wrote: >> How can I inject a subset of related photoalbums into this form? > > I don't know much about iteration of models, but in traditional ways, > you can create "choices" tuple from "Pho

Re: run multiple django app's on server

2008-01-30 Thread prz
[EMAIL PROTECTED] wrote: > That's the weird thing, > > If we restart httpd.conf the python code will be compiled in some > cases it will show one of the projects for both ports and in a other > case it will show the other for both ports without altering anything > to the code. Both are working fin

Simultaneous edits

2008-01-30 Thread Michael Hipp
Does Django have any built-in way to handle or prevent simultaneous, incompatible edits to a database record? Thanks, Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: "unknown locale: UTF-8"

2008-01-30 Thread omat
OK, I found it, it is a bug: http://code.djangoproject.com/ticket/5846 On Jan 30, 5:34 pm, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > When I try to syncdb I am getting a "unknown locale: UTF-8" error. > > I am using a recent checkout from the trunk with Postgres on MacOS X. > My database is U

Re: We're having an extremely difficult to diagnose problem:

2008-01-30 Thread Noah
Our default encoding is UTF-8 and that problem would manifest more often and not take out the whole server. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: run multiple django app's on server

2008-01-30 Thread web-junkie
That did it for me too, thanks! On Jan 30, 3:29 pm, prz <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > That's the weird thing, > > > If we restart httpd.conf the python code will be compiled in some > > cases it will show one of the projects for both ports and in a other > > case it wi

Re: database performance problem

2008-01-30 Thread [EMAIL PROTECTED]
On Jan 30, 1:33 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > def markable(checkins, project_category): > > projects = project_category.projects.all() > > res = [] > > for day in checkins.group_dates(): > > for ci in day: # for every checkin that day > > if

"unknown locale: UTF-8"

2008-01-30 Thread omat
Hi all, When I try to syncdb I am getting a "unknown locale: UTF-8" error. I am using a recent checkout from the trunk with Postgres on MacOS X. My database is UTF-8 and my DEFAULT_CHARSET is 'utf-8'. The application was used to run on different platforms as-is. Any ideas? Thanks, oMat Full

Re: "unknown locale: UTF-8"

2008-01-30 Thread super
On 30 jan, 16:34, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > When I try to syncdb I am getting a "unknown locale: UTF-8" error. > > I am using a recent checkout from the trunk with Postgres on MacOS X. > My database is UTF-8 and my DEFAULT_CHARSET is 'utf-8'. The > application was used to run o

Re: "unknown locale: UTF-8"

2008-01-30 Thread Thomas
Hi Omat, May be export LC_ALL=en_US.UTF-8 in terminal prior to syncdb would help. Regards, Thomas On Jan 30, 4:34 pm, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > When I try to syncdb I am getting a "unknown locale: UTF-8" error. > > I am using a recent checkout from the trunk with Postgres

setup.py in Windows install does nothing

2008-01-30 Thread Schmoopie
Newbie question: I followed the installation procedures for a Windows install. I go to a command window, get to the right directory, give the command setup.py install -- and nothing happens, in terms of getting anything the right module into my Python25\Lib\site-packages directory. What could hav

Iterating over very large queryset

2008-01-30 Thread Jarek Zgoda
Hello, I'd like to get some hints on memory usage by python/django program. I have standalone script that populates solr index with django application data. The queryset I have to process has over 16 objects. No matter if I use iterator() or not, the script eats more and more memory, finally

The plot thickens! Ticket #5171 and Intrigue on the Rack!

2008-01-30 Thread Noah
Ok so it seems we were having a problem with the issue described in Ticket #5171 because we were running Django96 and Django-Trunk on the same server using Psycopg2 and mod_python was using the same interpreter for them both. So we switched all the sites to use their own interpriters Now when you

Friends and Partners!!!

2008-01-30 Thread gelebej
Friends and Partners Find Friends and partners who are willing to do what you want and who have similar tastes while learning something else... http://bigchurch.com/go/g922367-pmem http://www.freewebs.com/gelebej/ http://indianfriendfinder.com/go/g922366-pmem --~--~-~--~~-

Re: Simultaneous edits

2008-01-30 Thread James Bennett
On Jan 30, 2008 9:18 AM, Michael Hipp <[EMAIL PROTECTED]> wrote: > Does Django have any built-in way to handle or prevent simultaneous, > incompatible edits to a database record? No, that's what your database's concurrency handling is for. -- "Bureaucrat Conrad, you are technically correct --

Re: Iterating over very large queryset

2008-01-30 Thread James Bennett
On Jan 30, 2008 10:21 AM, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Can you share any hints on how to reduce the memory usage in such > situation? The underlying database structure is rather complicated and I > would like to not do all queries manually. At this level -- hundreds of thousands of ob

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 8:57 AM, Mark Green <[EMAIL PROTECTED]> wrote: > Well, "Build for failure". Temporary overload can happen at any > time and I'd expect django to behave exceptionally bad in that > case as it is. Running out of resources is never a good thing for any system. > Disclaimer: I haven'

Re: Simultaneous edits

2008-01-30 Thread Michael Hipp
James Bennett wrote: > On Jan 30, 2008 9:18 AM, Michael Hipp <[EMAIL PROTECTED]> wrote: >> Does Django have any built-in way to handle or prevent simultaneous, >> incompatible edits to a database record? > > No, that's what your database's concurrency handling is for. Ok, I probably didn't expla

Re: "unknown locale: UTF-8"

2008-01-30 Thread omat
Yes! This solved the problem... Thanks a lot Thomas... On Jan 30, 5:51 pm, Thomas <[EMAIL PROTECTED]> wrote: > Hi Omat, > > May be > > export LC_ALL=en_US.UTF-8 > > in terminal prior to syncdb would help. > > Regards, > Thomas > > On Jan 30, 4:34 pm, omat <[EMAIL PROTECTED]> wrote: > > > Hi al

Re: django-queue-service documentation

2008-01-30 Thread Joseph Heck
Hi Tane, Yes - it can help. It's a good tool to basically take long running tasks and move them to an asynchronous mode. The trick, as always, is getting the results back to the user. There are basically two ways to use DQS with your app to make this work for you. The way it was originally cobbl

Dynamic Parameter Names

2008-01-30 Thread [EMAIL PROTECTED]
I'm new to python and django and I'm trying to do dynamic queries. Can't quite get it to work right, however. This is what I'm trying to do. field = "desc" query = User.objects.filter( field = "john") but meaning `field` the variable, not the column. I don't think that python does that, then w

Re: Dynamic Parameter Names

2008-01-30 Thread Tim Chase
> I'm new to python and django and I'm trying to do dynamic queries. > Can't quite get it to work right, however. This is what I'm trying to > do. > > field = "desc" > query = User.objects.filter( field = "john") > > but meaning `field` the variable, not the column. I don't think that > python

Re: The plot thickens! Ticket #5171 and Intrigue on the Rack!

2008-01-30 Thread Noah
IT seems it can happend when you make many concurent requests, the site is hosting 27 django projects as is , 25 on Django 0.95 and 3 on Trunk each using it's own interpriter in mod_python but if you open them all at the same time 2 or 3 of them (random ones) will give errors saying they can't fin

Re: Dynamic Parameter Names

2008-01-30 Thread [EMAIL PROTECTED]
Thank you! On Jan 30, 11:42 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > I'm new to python and django and I'm trying to do dynamic queries. > > Can't quite get it to work right, however. This is what I'm trying to > > do. > > > field = "desc" > > query = User.objects.filter( field = "john") > >

Re: We're having an extremely difficult to diagnose problem:

2008-01-30 Thread Ivan Illarionov
The problem here is not about wrong encoding of strings - it's all about unicode/string relationship and from-unicode-to-string/from- string-to-unicode problem. I really think that it will be fixed if you replace return textile.textile(value, encoding=settings.DEFAULT_CHARSET, output=settings.DEF

I now understand what's happening on the markets

2008-01-30 Thread Littlemonsta
I was at a loss as to the cause of recent volatility on the markets, so I did a little research and found a website that explains exactly what's going on here - www.basherbusters.com. I signed up for free and was pleasantly surprised to get daily email reports with the most recent additions to the

Re: We're having an extremely difficult to diagnose problem:

2008-01-30 Thread Ivan Illarionov
If you don't want to rely on Django's smart_str, you can do following: if isinstance(value, unicode): value = value.encode('utf-8', 'ignore') return textile.textile(value, encoding=settings.DEFAULT_CHARSET, output=settings.DEFAULT_CHARSET) textile.textile() certainly breaks with your error if

Re: Iterating over very large queryset

2008-01-30 Thread Jacob Kaplan-Moss
On 1/30/08, James Bennett <[EMAIL PROTECTED]> wrote: > On Jan 30, 2008 10:21 AM, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > > Can you share any hints on how to reduce the memory usage in such > > situation? The underlying database structure is rather complicated and I > > would like to not do all qu

why did admin delete my data?

2008-01-30 Thread Carl Karsten
I did this: http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ wrote a data migration.py to convert data. I browse to the django admin ui, and I can see the data. if I edit it, or not edit it, then hit Save, it deletes the User Profile record. I hit history, and i

Re: why did admin delete my data?

2008-01-30 Thread James Bennett
On Jan 30, 2008 2:22 PM, Carl Karsten <[EMAIL PROTECTED]> wrote: > title = models.CharField("Title", core=True, max_length=80, blank=True, > null=True) > surname = models.CharField("Surname", max_length=65, core=True, > blank=True, > null=True) There's your culprit. Whenever you try t

Re: why did admin delete my data?

2008-01-30 Thread Carl Karsten
James Bennett wrote: > On Jan 30, 2008 2:22 PM, Carl Karsten <[EMAIL PROTECTED]> wrote: >> title = models.CharField("Title", core=True, max_length=80, blank=True, >> null=True) >> surname = models.CharField("Surname", max_length=65, core=True, >> blank=True, >> null=True) > > There's y

Re: Simultaneous edits

2008-01-30 Thread Tane Piper
I've seen this in some Wiki code before, and surprisingly Joomla! Add a checked_out flag, which is a boolean field in the table. When a user opens the entry, you could possibly use a post_view signal to set the object as checked_out, so when someone else opens it, it tells the user that someone

Trying to dynamically generate labels in newforms

2008-01-30 Thread Kirk Strauser
I'm using a Newforms subclass, and trying to dynamically generate the labels for each field at runtime (long story, but it really does make sense for what we're doing). Apparently I'm doing something wrong, though, because I always end up with the default label text and not what I'm specifying.

Re: Trying to dynamically generate labels in newforms

2008-01-30 Thread Paul
The BaseForm.__init__ sets self.fields to self.base_fields.copy() before your __init__ is run. The correct way to change the label is: class TestForm(forms.Form): somefield = forms.IntegerField(label='foo') On Jan 30, 1:06 pm, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I'm using a Newforms

Access context from with a custom filter

2008-01-30 Thread Paul
I need to access the context from within a filter. The filter needs to change its behavior based on the target browser (context.request.META.HTTP_USER_AGENT). There doesn't appear to be any way to access this information from inside the filter. Nor is there any way to pass this info into the fi

Re: ordering help

2008-01-30 Thread Rajesh Dhawan
Just copying my emailed response here for posterity. > > I have a database that stores unit numbers in postgresql eg 3B , 2, 5 , 4C, 1 etc.. so it had to be string type for the letters but now i want to order them in ascending order on the template eg. I would do the following: In your Unit o

Re: run multiple django app's on server

2008-01-30 Thread Graham Dumpleton
Setting PythonInterpreter should not have been required as when VirtualHost's are configured properly mod_python will give each VirtualHost a different interpreter anyway. The cause of this probably has generally been that the Apache configuration was missing an appropriate NameVirtualHost direct

Re: Access context from with a custom filter

2008-01-30 Thread Alex Koshelev
Look at thread local storage. Here is an example this user instance save: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On 31 янв, 00:28, Paul <[EMAIL PROTECTED]> wrote: > I need to access the context from within a filter. The filter needs > to change its behavior based on the t

Re: Newbie Question

2008-01-30 Thread Tim Sawyer
Thanks everyone, I've been reading my Python In a Nutshell ("covers python 2.2!") and it's reminded me of what I've forgotten! Any suggestions for good books? Was going to get the django book and the O'Reilly Python Cookbook. On Tuesday 29 Jan 2008, Ivan Illarionov wrote: > or, better: >d

keep children from running away

2008-01-30 Thread Carl Karsten
OK, I think my data is going away because of my choice of blank and core. Ideally, I don't care if the record stays around even if it is 100% blank. either way, this is the only case I want it deleted. If there is any data in it, I do not want to loose it. but the way I have it currently the

Re: setup.py in Windows install does nothing

2008-01-30 Thread Schmoopie
This has now been resolved, by moving the django file onto a site in the PYTHONPATH -- thanks to the good folks at the IRC channel for assistance. On Jan 30, 6:19 pm, Schmoopie <[EMAIL PROTECTED]> wrote: > Newbie question: I followed the installation procedures for a Windows > install. I go to a

Re: Newbie Question

2008-01-30 Thread J. Clifford Dyer
On Wed, 2008-01-30 at 23:01 +, Tim Sawyer wrote: > Thanks everyone, I've been reading my Python In a Nutshell ("covers python > 2.2!") and it's reminded me of what I've forgotten! > > Any suggestions for good books? Was going to get the django book and the > O'Reilly Python Cookbook. > >

Re: django-queue-service documentation

2008-01-30 Thread Tane Piper
Hi Joe, That sounds fantastic - I think we might look at integrating it into the application as it's pretty vital (imagine having to wait for a 50 or 100mb repository to clone!). If your interested, I'd be happy to provide some code back if we can make any improvements. For example, we're using

ForeignKey related bug

2008-01-30 Thread [EMAIL PROTECTED]
Hi, While building a blog type application, I seem to have stumbled upon a bug. In a nut shell all object attributes have become read only when I fetch the object from a query set which is fetched using the xxx_set() API. Please see the pdb trace for details. I have added comments to depict the

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread Mark Green
On Wed, 2008-01-30 at 11:03 -0600, James Bennett wrote: > On Jan 30, 2008 8:57 AM, Mark Green <[EMAIL PROTECTED]> wrote: > > Well, "Build for failure". Temporary overload can happen at any > > time and I'd expect django to behave exceptionally bad in that > > case as it is. > > Running out of res

Re: Trying to dynamically generate labels in newforms

2008-01-30 Thread Kirk Strauser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jan 30, 2008, at 3:22 PM, Paul wrote: > > The BaseForm.__init__ sets self.fields to self.base_fields.copy() > before your __init__ is run. The correct way to change the label is: > > class TestForm(forms.Form): >somefield = forms.IntegerFiel

Filtering data by foreign key.

2008-01-30 Thread Elliott
In part of my database, I have a Planet model and a Base model, and the two are closely related. There can only ever be one Base per Planet, but some (most, actually) planets don't have Bases. In one of my views, I need to get a list of Planets that don't have bases on them. If I were using OneToO

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 6:01 PM, Mark Green <[EMAIL PROTECTED]> wrote: > Ahem, there's a huge difference between being confronted with > a spinner/progress bar or an error page. The former speaks > "Please wait", the latter speaks "Try again". OK, so let's break this down. There are two potential cases

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread Mark Green
On Wed, 2008-01-30 at 19:34 -0600, James Bennett wrote: > On Jan 30, 2008 6:01 PM, Mark Green <[EMAIL PROTECTED]> wrote: > > Ahem, there's a huge difference between being confronted with > > a spinner/progress bar or an error page. The former speaks > > "Please wait", the latter speaks "Try again"

My Django under Vista also lags

2008-01-30 Thread [EMAIL PROTECTED]
But I don't have ZoneAlarm - maybe it's a Python problem. The rendering time of a single request takes up to 8 seconds. On my ubuntu machine everything is lightning fast. Does anyone has some ideas? *.sebastian --~--~-~--~~~---~--~~ You received this message becau

Re: My Django under Vista also lags

2008-01-30 Thread Russell Keith-Magee
On Jan 31, 2008 12:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > But I don't have ZoneAlarm - maybe it's a Python problem. The > rendering time of a single request takes up to 8 seconds. On my > ubuntu machine everything is lightning fast. Does anyone has some > ideas? I've seen this be

How to know if an object is being created in the save() method?

2008-01-30 Thread Julien
Hello there, Does the title says it all? When overriding the save method of an object, I'd like to know if that object is being created or updated. How I do it so far is: def save(self): if self.pk: ...=> being created else: ...=> being updated I vaguely remember seeing

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 8:55 PM, Mark Green <[EMAIL PROTECTED]> wrote: > What ressources are held and wasted exactly? > Maintaining a number of open TCP connection is much cheaper > than creating/discarding them at a high rate. Every connection that one Django application holds on to is a connection that

newforms-admin and OneToOne field

2008-01-30 Thread NickJ
In contrib.admin in django trunk, on a one-to-one relationship, the + mark exists that pops up a window to allow you to add the related 'base' field, working exactly the same as a ForeignKey field. Testing out newforms-admin, I see this functionality has been removed, at least by default. Is ther

Re: How to know if an object is being created in the save() method?

2008-01-30 Thread Ivan Illarionov
There is 'post_save' signal with 'created' parameter. But, unfortunately, this feature is undocumented... On Jan 31, 6:44 am, Julien <[EMAIL PROTECTED]> wrote: > Hello there, > > Does the title says it all? When overriding the save method of an > object, I'd like to know if that object is being

*Idea-Share* How to secure auth

2008-01-30 Thread Ravi Kumar
Hi, I have developed a Django project with 3 apps. Now, I have to implement authentication for 2 apps, while one app will be public without any authentication. But I don't want to run two virtual servers with HTTP and HTTPS differently. The condition is, when a page requiring authentication, it sho

Re: How to know if an object is being created in the save() method?

2008-01-30 Thread Eren Türkay
On 31 Jan 2008 Thu 06:22:43 Ivan Illarionov wrote: > There is 'post_save' signal with 'created' parameter. But, > unfortunately, this feature is undocumented... It's something related with "dispatcher" class? Please let me know if there is more about signals than the code below. I simply just us

Order the table A by a field in table B, but A don't has fk to B

2008-01-30 Thread Yoshio
I want order the table A by a field in table B class A(models.Model): field1 = models.CharField() class B(models.Model): field1 = models.CharField() field_fk = models.ForeignKey(A) The table A don't has fk to B, but B has a fk to A. I want to do anything like this: query = A.objects

Re: How to know if an object is being created in the save() method?

2008-01-30 Thread Michael Elsdörfer
>> There is 'post_save' signal with 'created' parameter. But, >> unfortunately, this feature is undocumented... > > It's something related with "dispatcher" class? Please let me know if > there is more about signals than the code below. I simply just use > this; If you use post_save instead

Re: How to know if an object is being created in the save() method?

2008-01-30 Thread Michael Elsdörfer
> def save(self): if self.pk: ...=> being created else: ...=> being > updated > > I vaguely remember seeing a parameter for the save method which would > do that, but I can't find it. Any thoughts? That's the correct way to do it, unless you want to use signals: http://www.martin-geber.com

Re: Trying to dynamically generate labels in newforms

2008-01-30 Thread Michael Elsdörfer
> There's no other way to set it? Just set the labels *before* calling super(). Michael --~--~-~--~~~---~--~~ 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@googl

posible bug

2008-01-30 Thread Andres Vargas - zodman
I have configure the flatpages with his html template on my template_dir/flatpages/default.html When run python manage.py runserver on my settings DEBUG=True the flatpage show right but change a DEBUG=False i get this output: Traceback (most recent call last): File "/usr/lib/pytho

Re: How to know if an object is being created in the save() method?

2008-01-30 Thread Ivan Illarionov
Example of post_save with 'created' flag is in Django tests: http://code.djangoproject.com/browser/django/trunk/tests/modeltests/signals/models.py --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: django-queue-service documentation

2008-01-30 Thread Joseph Heck
I'm always willing to take suggestions. We've expanded on the basics in the "unstable" branch - mostly focusing on adding a pure REST interface, which Rajesh has done a wonderful job with. It does have it's own settings when using it standalone - it's a pretty straight-up Django application that w

Any way to know if a value has changed before saving?

2008-01-30 Thread Julien
Hi there, I'd like to override the save() method and within it I'd like to test if a value has changed, that is, if that value as stored in the object (in memory) is different from what is actually stored in database. Something like: class A: stuff = models.blabla def save(self): if sel