Re: How to execute some user defined codes (functions) when Django boot?

2010-08-17 Thread Paul Winkler
Seems to me that "on boot up" doesn't mean anything in a shared- nothing architecture like Django's. For example if you deploy on eg. mod_wsgi. You have no idea how long any particular thread or process is going to live, and no idea how often this "boot" code would get run. But assuming that's OK

what to do instead of adding to Query.extra_where ?

2010-09-01 Thread Paul Winkler
Hi folks, I'm working on a codebase (a fork of http://code.google.com/p/ebcode/) that is supposed to be run against Django 1.1. It has several lines like this: clone.query.extra_where += ('db_newsitem.id = db_attribute.news_item_id',) That line raises a traceback like this: Traceback (most

Re: what to do instead of adding to Query.extra_where ?

2010-09-01 Thread Paul Winkler
: clone.query.extra_where += ('db_newsitem.id = db_attribute.news_item_id',) the replacement is now: clone = clone.extra(where=('db_newsitem.id = db_attribute.news_item_id',)) Seems to work fine. On Sep 1, 11:41 pm, Paul Winkler wrote: > Hi folks, > > I'm wo

Re: Unit testing in django without using test client

2010-09-16 Thread Paul Winkler
On Sep 16, 10:11 am, girish shabadimath wrote: > thanks for reply, > actually i used unit test to test urls and other view functions,,,there is a > module called Client() in django which acts as a browser to test urls,,, > > my problem is ,i want to test other methods in my project,,, how to do >

Re: Launching Background Processes from a View

2010-09-16 Thread Paul Winkler
On Sep 16, 10:11 am, Heath wrote: > My eventual solution was to just rework the way my watcher scripts > execute. I now use celery and rabbitMQ, and let pyInotify send a new > job to any available worker. For my application, 20 or so workers is > fine and this can scale as needed. > > I'm still lo

Re: Unit testing in django without using test client

2010-09-17 Thread Paul Winkler
has plenty of examples, many without using django.test.client. -- Paul Winkler http://www.slinkp.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe

Re: Unit testing in django without using test client

2010-09-17 Thread Paul Winkler
has plenty of examples, many without using django.test.client. -- Paul Winkler http://www.slinkp.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe

Re: output shapefiles

2010-10-12 Thread Paul Winkler
If you're using PostGIS, one option might be to call its dumper as a separate process. http://postgis.refractions.net/docs/ch04.html#id2638528 Don't know what tools exist for other spatial databases... On Oct 12, 1:50 am, Evan Bowling wrote: > Hello all! > >     I was wondering if anyone knew i

Re: HTTP load testing tools?

2010-10-13 Thread Paul Winkler
On Oct 13, 4:17 am, Chris Withers wrote: > Hey all, > > I hope this is still on topic, but what tool sets do people around here > use for doing load testing of Django projects? Same stuff as for any web project. Last time I needed something more than ab, I used funkload (it's on pypi). A bit of

Re: HTTP load testing tools?

2010-10-19 Thread Paul Winkler
On Oct 13, 10:27 am, Paul Winkler wrote: > On Oct 13, 4:17 am, Chris Withers wrote: > > > Hey all, > > > I hope this is still on topic, but what tool sets do people around here > > use for doingloadtestingof Django projects? > > Same stuff as for any web proje

Re: call more than one view action from an uri path?

2010-10-21 Thread Paul Winkler
On Oct 21, 10:39 am, Steve Holden wrote: > REST, however, has a fairly rigid one-URL-one-action structure Obligatory REST nitpick: REST maps URIs to resources, not actions. In HTTP, the HTTP methods specify the action to perform. (REST as described by Fielding also has nothing whatsoever to say

Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Paul Winkler
It would sometimes be useful to be able to write fixtures that essentially say "I don't care what the PK of this record is, as long as I have a way for other records in this fixture to refer to it." Use case: I'd like a way to pass around useful data sets that people can load into deployments of m

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Paul Winkler
Thanks Shawn! That was quick! Meanwhile I just discovered http://farmdev.com/projects/fixture which I have just confirmed works fine for hand-written fixtures with my app, although using python classes as fixtures feels a little odd. Nice that it's cross-platform though, it supports sqlalchemy and

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Paul Winkler
ere. - PW On Oct 22, 12:38 pm, Paul Winkler wrote: > Thanks Shawn! That was quick! > > Meanwhile I just discoveredhttp://farmdev.com/projects/fixturewhich > I have just confirmed works fine for hand-written fixtures with my > app, although using python classes as fixtures feels

Overriding the JOIN type in contrib.admin's search forms?

2008-06-17 Thread Paul Winkler
Bear with me, I'm a Django novice, still reading docs... I'm trying to build my first app using django admin (release 0.96), because it's a good match to the requirements (a quick and simple CRUD application). I found a thread from last year http://groups.google.com/group/django-users/browse_thr

Re: unit testing and comparing dictionaries

2008-06-17 Thread Paul Winkler
On Jun 17, 1:46 am, "Gene Campbell" <[EMAIL PROTECTED]> wrote: > Hello Djangonauts > > I'm a noob on both Django and Python, so this question might be easy > for the experts out there. I am trying to do test first development > during the development of my model code. (I have lots of experience

Re: Overriding the JOIN type in contrib.admin's search forms?

2008-06-23 Thread Paul Winkler
Nobody cares? To me this seems like a significant bug in contrib.admin ... okay I'm filing it as such: http://code.djangoproject.com/ticket/7528 - PW On Jun 17, 2:08 pm, Paul Winkler <[EMAIL PROTECTED]> wrote: > Bear with me, I'm a Django novice, still reading docs... >

Re: Overriding the JOIN type in contrib.admin's search forms?

2008-06-24 Thread Paul Winkler
On Jun 23, 11:30 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > It's a leap from no response to nobody cares. Yes, sorry for that, I didn't mean to be rude. > One thing, though, which may have made a lot of people pass over it is that > you are reporting a problem with they way queries are cons

Re: Overriding the JOIN type in contrib.admin's search forms?

2008-07-02 Thread Paul Winkler
Followup: This bug is fully fixed on the newforms_admin branch. Thanks for the help! --~--~-~--~~~---~--~~ 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@googlegro

Re: Bringing down a website

2010-12-13 Thread Paul Winkler
On Dec 13, 10:20 am, Shamail Tayyab wrote: > What could be the simplest way to do it without altering any of my > current views or anything? Write a view for /shutdown which sets some global flag eg. in the database, then write some middleware to do the rest: http://docs.djangoproject.com/en/dev/