Re: check if request.url is a known string

2008-10-15 Thread pength
Maybe you can try {% ifequal request.META.PATH_INFO "/ricerca/" %}, but I think a templatetag will do this better. ;) On Oct 14, 3:53 pm, Alessandro <[EMAIL PROTECTED]> wrote: > I have a menu with a class="active" to insert when a page is loaded. > > I am searching a way to put this

Re: a thread problem or my bad codes?

2008-07-01 Thread pength
? > > problem being that if all those processes happen at about the same > time, they will all see enough money, then they will all process it. > > On Jul 1, 5:12 am, pength <[EMAIL PROTECTED]> wrote: > > > > > sorry for the bad indent of the "#models.py"

Re: a thread problem or my bad codes?

2008-07-01 Thread pength
e) people = models.ForeignKey(People) dealt_date = models.DateTimeField(auto_now_add=True) On Jul 1, 4:53 pm, pength <[EMAIL PROTECTED]> wrote: > I am using Django0.96/apache2/mod_python(running prefork MPM) / mysql, > for my Django project, a typical Django environment, I think. And >

a thread problem or my bad codes?

2008-07-01 Thread pength
I am using Django0.96/apache2/mod_python(running prefork MPM) / mysql, for my Django project, a typical Django environment, I think. And usually there're more than 10 apache2 processes running on my site, as the online users is about 100+. I found a problem that sometimes if one user clicks a

Re: Is it possible not to use RequestContext in Generic Views?

2008-06-24 Thread pength
:06 am, pength <[EMAIL PROTECTED]> wrote: > As Generic Views are using RequestContext by default, in most cases > it's quite good. But I have some special generic views, which will > populate the result via Ajax, so, to make it more effecient, I don't > want the views to use Reque

Is it possible not to use RequestContext in Generic Views?

2008-06-24 Thread pength
As Generic Views are using RequestContext by default, in most cases it's quite good. But I have some special generic views, which will populate the result via Ajax, so, to make it more effecient, I don't want the views to use RequestContext. but how to "disable" RequestContext in generic views?

Re: why my django site doesn't create .pyc file?

2008-06-09 Thread pength
Tim and Scott, thank you very much! On Jun 9, 10:03 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > >> I think this way, apache could be a little more faster. Am I > >> right? > > > I don't think it will be faster. Django normally runs as a > > long-standing process (either inside Apache or as a

Re: why my django site doesn't create .pyc file?

2008-06-09 Thread pength
nough privileges to write in the > directories containing .py files. > > Regards, > Valts. > > On Mon, Jun 9, 2008 at 1:25 PM, pength <[EMAIL PROTECTED]> wrote: > > > I have justed built my site on slicehost. Alhough my site is running > > properly, I found if I update

why my django site doesn't create .pyc file?

2008-06-09 Thread pength
I have justed built my site on slicehost. Alhough my site is running properly, I found if I update any file (.py file, of course), it never recreate the .pyc file. Actually, if I delete any .pyc file, then it will never appear. I think there's something wrong with my site config, can anyone

Re: Why the default Django transaction way doesn't work?

2008-01-31 Thread pength
I found that the problems comes because I am using a middleware of perform_bench... so no problem here, just write this info. in case any other people falls the same trap. ;) On Jan 13, 2:41 pm, pength <[EMAIL PROTECTED]> wrote: > Thanks for your reply. > > I am using MySQL 5.0.

Re: Why the default Django transaction way doesn't work?

2008-01-12 Thread pength
transaction? or I am wrong on this point? On 1月13日, 上午3时06分, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Transaction behaviour depends on database backend. What backend do you > use and have you setup transaction support for it? > > On 12 янв, 20:45, pength <[EM

Why the default Django transaction way doesn't work?

2008-01-12 Thread pength
At first, I tried to search in this group, but only got an un-answered question similar to mine: http://groups.google.com/group/django-users/browse_thread/thread/767716b62a244b33/85b8203990407a6c?lnk=gst=transaction+default#85b8203990407a6c in my settings.py, i am using TransactionMiddleware.

is it safe to use connection.close() like this?

2007-12-28 Thread pength
hello all, together with my Djano app, I am using an independently- running python scripts, using Django's ORMs. It's running like a daemon, check one table in DB, and calls function at pre-set time. The main codes are like: def main_daemon(): for event in

Re: Django Browser Games?

2007-10-07 Thread pength
I am working on a same type of webgame, and it's also on the very early stage. though it supports Chinese and English, now the content is mainly in Chinese, so I just can't write the testing address here. I'll mail to you, if you are interest, just take a look there. On 10月7日, 下午10时33分, Russell

Re: how to do something at startup

2007-09-29 Thread pength
well, I am doing some similiar things, for example, I want to show the time when this Django/Apache server start, and set some "gloabl variables" which all of my apps can use, just do like this: I have a primary app named "city", and every other app's views.py will add a line as "from

Re: Multiple one-to-one relationships for a single class

2007-08-31 Thread pength
I am not very sure if I have any misunderstanding about your situation, but I am doing a similiar "multi-oneotoone-relation" in my project. My models are like these: class Daemon_Event_List(models.Model): ###this is a basic event list, but only record the event time event_type =

Re: problem about i18n in apache

2007-02-05 Thread pength
well, the locale directory should be in up-level of project directorysorry for disturbing. ;) On 2月5日, 下午2时05分, "pength" <[EMAIL PROTECTED]> wrote: > i am using i18n as the following way. In urls.py, i added > (r'^i18n/', include('django.conf.urls.i18n')), > a

problem about i18n in apache

2007-02-04 Thread pength
i am using i18n as the following way. In urls.py, i added (r'^i18n/', include('django.conf.urls.i18n')), and in my page, there're 2 buttons as http://localhost:8000/i18n/setlang/?language=zh-cn http://localhost:8000/i18n/setlang/?language=en in my dev server (manage.py runserver), everything is

how to run a non-web application with models in django?

2006-11-18 Thread pength
my problem is very similar with: http://groups.google.com/group/django-users/browse_frm/thread/43b3e6d2d0a691d/f2e05622f3aef6bb?lnk=gst=__main__+models=2#f2e05622f3aef6bb but there i don't think someone had solved that question. so I just make that question simple. I have set environment vars of

newbie question about using javascript to handle vars in template..

2006-11-12 Thread pength
in my template file, there's a var which i can use {{var1}} to get its value. and if i put the code document.write({{var1}}); DIRECTLY in my template file, it's OK, the var1's value appears in my .html file. but if I use in template file, and then in my.js, write document.write({{var1}});

Re: Accessing request and session objects from templates

2006-11-07 Thread pength
i think i am facing the same problem with [EMAIL PROTECTED] well, i have done as Jorge suggested, but just don't know how to retriving the my_data in my_template.html. I tried with {{my_data.key}}, though no error occurred, but there's no value appeared

Re: how to set some global constant in my Django project?

2006-10-30 Thread pength
thanks Terry. I posted 3 days ago, just couldn't see it in the list until now. ;( On Oct 31, 1:29 am, "Terry" <[EMAIL PROTECTED]> wrote: > pength wrote: > > I think it's a common way in C or C++ project to do like this, just > > don't know how to do it

how to set some global constant in my Django project?

2006-10-30 Thread pength
first, I have searched in this group as "settings". "global constant"...etc, but i don't think I have got what I need. ;( well, I want to define some global constant, like: MAX_UNIT_FOR_ONE_USER = 100 then I want to use this constant in all the applications of my whole project, in my