Django 1.0 admin with inline model, IntegrityError when delete

2008-09-03 Thread Arnold Chen
I have upgraded to django 1.0 beta or the latest version for my development machine. And faced IntegrityError when i delete a record with few related records. This problem do not happen before django 1.0 A Product model and a Part model, which is a 1-to-many relationship, (a Product can have

Re: Method 'allow_tags' doesn't work?

2007-11-16 Thread Arnold Chen
I also faced this problem, i have a rolled-out site, using the allow_tags method to do a critical mission in a customized admin site. regards, Arnold On Nov 16, 3:34 am, wowar <[EMAIL PROTECTED]> wrote: > Today, after updating django to revision 6678 method 'allow_tags' > doesn't work. Despite

Re: ImageField Validation Error

2007-11-15 Thread Arnold Chen
I faced this problem as well, but there is a work around. I am using django 0.97 pre (i downloaded from svn 16th Nov, 2007) Go to c:/python2.4/lib/site-packages/django/core/validators.py or /usr/lib/python2.4/site-packages/django/core/validators.py , if you are using Fedora comment the

Re: Using auth in model

2007-11-09 Thread Arnold Chen
Sorry, there is a typo mistake, my question is "how to get logged-in" user WITHOUT request parameter. Because i want to use it in a function in models.py regards, Arnold On 11月8日, 下午8時18分, Dan Fairs <[EMAIL PROTECTED]> wrote: > > My question above can be simplified as "how to get logged-in user

Re: Using auth in model

2007-11-07 Thread Arnold Chen
My question above can be simplified as "how to get logged-in user with request parameter" On Nov 8, 12:32 pm, Arnold Chen <[EMAIL PROTECTED]> wrote: > I want to let users to create their own profile in django admin. And > when they save any new records, use t

Using auth in model

2007-11-07 Thread Arnold Chen
I want to let users to create their own profile in django admin. And when they save any new records, use their logged-in user id (models.ForeignKey(User)) and override the save() function of the model. Is there any statement that i can use? i believe it should be something like auth.user thanks

i18n/setlang no longer support GET

2007-09-20 Thread Arnold Chen
I used to use /i18n/setlang?language=zh-cn approach to change language. However i found that the latest (as of this writing 20th Sept, 2007) svn version django do not support calling the url using GET, and there is a sentence in the function set_language in the i18n.py file "Since this view

Re: SOMETIMES mod_python error

2007-09-11 Thread Arnold Chen
Yes, the server has been restarted many times On 9月11日, 下午6時54分, Ryan K <[EMAIL PROTECTED]> wrote: > Have you tried restarting the web server? > > Arnold Chen wrote: > > Dear all, > > > I am experiencing some situation that is very strange. the development > >

Re: php fsockopen equivalent in Django

2007-09-09 Thread Arnold Chen
How come i don't remember using the python socket ? thanks James On Sep 10, 1:13 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 9/9/07, Arnold Chen <[EMAIL PROTECTED]> wrote: > > > I am writing an application that require "silent"

php fsockopen equivalent in Django

2007-09-09 Thread Arnold Chen
Dear All, I am writing an application that require "silent" post of data to a specific URL. I know that is a function fsockopen in PHP which can achieve this, and i am looking for function in Django like that. fsockopen is used to Open Internet or Unix domain socket connection. and you can post

Re: Using session variable in models

2007-07-25 Thread Arnold Chen
t; > @property > > def name(self): > > if translation.get_language()=="en": > > return self.name_en > > else: > > return self.name_de > > > good luck > > > wolfram > > > On 7/25/07, Arnold

Using session variable in models

2007-07-25 Thread Arnold Chen
I am implementing a multi-lingual product catalog website with Django. It is in English (default), Trad. Chinese and Simp. Chinese. I want to let user to choose the language they want, and the system display the corresponding product name (in the selected language). The product class is

Re: Django serving static PDF file

2007-07-17 Thread Arnold Chen
they run in browsers, and most of the time, they hang the browser, so is there a way to push ? regards, Arnold On Jul 17, 4:03 pm, Arnold Chen <[EMAIL PROTECTED]> wrote: > Thanks Ben, > > Besides, i've found thatwww.lawrence.comandwww.ljworld.com(which > are famous sites that use

Re: Django serving static PDF file

2007-07-17 Thread Arnold Chen
just make a directory > that won't be handled by Django and stick all your static content in > there. After all, the webserver is usually better at serving static > files than Django is :) > > On 17/07/2007, at 2:26 PM, Arnold Chen wrote: > > > > > Can any one please tell

Django serving static PDF file

2007-07-17 Thread Arnold Chen
Can any one please tell me how to serve a static PDF in django ? The file is located in the server, and do not need to be created on the fly (by using report lab). I have done it in PHP by using header, but i just don't know how to do it with django. Thanks