How to instantiate django.test.Client out of django unittest framework

2009-11-25 Thread Alex Dong
Hi all, The software we're developing uses sphinx search engine whose index updating process doesn't play well with django's unittest setup, as a result we have to move all the tests from django to nosetest. I found one of your test talk on djangocon and you mentioned that we could 'instantiate C

How to tell whether the current module is loaded under `manage.py test`

2009-11-25 Thread Alex Dong
Hi all, During the `manage.py test` process, django will automatically change the database from `hivemind` to `test_hivemind`, For similar reason, I'd like to change a file path from `sphinx.conf` to `sphinx_test.conf` but unfortunately I couldn't find a proper way to do it. Ideally, if there is

Re: Django implementation of AssetPackager, anyone?

2007-12-10 Thread Alex Dong
What's tricky here is how to do all of these on the fly and update the output if there is any changes to the underlying javascript files. Any thoughts on how to do that? Or, maybe we should use a svn hook instead of django template tag for this task? Alex On Dec 11, 12:47 am, David Reynolds <[E

Django implementation of AssetPackager, anyone?

2007-12-10 Thread Alex Dong
Hello everyone, I'm wondering are there anyone who is working on a django version of the AssetPackager? I found it's a pretty cool performance booster with little work required from the developer side. Definitely a tool for perfectionist. :-) Here is the url of the ruby version: http://synthes

Whether 2G RAM dedicated server could support a django site with 190 reqs/sec?

2007-04-27 Thread Alex Dong
Hi Folks, I'm planning to host our new django based website on dedicated server hosting. Besides having a shared DreamHost account, I don't have too many experiences in this. I'll definitely do stress tests to check but before I put the purchase order, I'd love to hear whether do you think the h

Re: Running django in standalone mode

2007-04-11 Thread Alex Dong
ckage/django/:/ home/alex/projects/" export DJANGO_SETTINGS_MODULE="looker.settings" python $1 -->% HTH, Alex On Apr 12, 8:46 am, "Alex Dong" <[EMAIL PROTECTED]> wrote: > Thanks many. It works like a charm now. > > Alex > > On

Re: Running django in standalone mode

2007-04-11 Thread Alex Dong
ng you > created your django project the standard way), and will then be able > to import the settings module from the looker package. > > On Apr 11, 3:57 am, "Alex Dong" <[EMAIL PROTECTED]> wrote: > > > I'm having a bunch of cron jobs which will use django

Running django in standalone mode

2007-04-11 Thread Alex Dong
I'm having a bunch of cron jobs which will use django model and send_mail features. I've read through this link http://groups.google.com/group/django-users/browse_thread/thread/51827a2a40e5262e/bb66770dfff75cfe but for some unknown reason, I still can't use django's model. Will anyone kindly look

Does django provide a parse_FOO_display? ie. get_FOO_display reverted.

2007-03-27 Thread Alex Dong
Hi Folks, I'm wondering are there any "parse_FOO_display" method for the django models? For example: {{{ class Transaction(models.Model): STATUS = ( (1, 'Canceled_Reversal'), (2, 'Completed'), (3, 'Pending'), (4, 'Refunded'), (5,

Re: Retrieve `request` object in `urls.py`?

2007-03-25 Thread Alex Dong
Thanks Malcolm, sounds like `getattr` might be a good solution. I'll take a look into that and post back. -- Alex On Mar 26, 9:58 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-03-25 at 18:22 -0700, Alex Dong wrote: > > Hi Malcolm, > > > Thanks fo

Re: Retrieve `request` object in `urls.py`?

2007-03-25 Thread Alex Dong
t_home_url * request.user.get_watch_list_url * request.user.private_message ... So my views.py file ends up with lots of this one line methods, which I found a little bit 'unclean'. Alex On Mar 26, 8:59 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Hi Alex, > > > > On Sun, 2007-03-2

Retrieve `request` object in `urls.py`?

2007-03-25 Thread Alex Dong
Hi folks, I'd like to refactor the following code into one line in urls.py: Now: in `urls.py`: +(r'^watchlist/$', 'package.watchlist.views.rredirect_to_personalized_watch_list'), +(r'^users/(?P.*)/watchlist/$', 'package.watchlist.views.watchlist'), in `views.py`: [EMAIL PROTECTED] +def r

Is Signal multiple machine safe?

2007-03-12 Thread Alex Dong
Hi all, I'm using post_save signal to send a "Your Account is Created" type of email. Since I have four machines, two django front end server pointing to two MySQL cluster, I'm wondering is the post_save signal multiple machine safe? That is, if my signal is processed, is it possible that the "i

Re: How to implement multi-level cascaded DISTINCT JOIN using django's object model?

2007-03-08 Thread Alex Dong
on/ db_api/#queries-over-related-objects). This is really powerful yet simple enough. Alex On Mar 9, 12:56 am, Atilla <[EMAIL PROTECTED]> wrote: > On 08/03/07, Alex Dong <[EMAIL PROTECTED]> wrote: > > > > > > > Hi all, > > > I have a data model like this

How to implement multi-level cascaded DISTINCT JOIN using django's object model?

2007-03-08 Thread Alex Dong
Hi all, I have a data model like this: * a `user` has multiple `questions` * a `user` could give multiple `answer`s or `comment`s to any `question`s. So here, there are * a one-to-many relationship from `user` to `question` * a many-to-many relationship between `question` and `answer`, `question`