Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
> On Jun 29, 4:01 pm, Stephen Cheng <stephenchengm...@gmail.com> wrote: > > > Yes, I check thecookievalue in view or in middleware class. > > > Just give example, eg, I want the browser to remember online user's > > city, so next time when they typewww.mydomain.com, it

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
ies are sent only when the request reaches > the server. > > -- Raja > > On Jun 29, 9:21 am, Stephen Cheng <stephenchengm...@gmail.com> wrote: > > > Hi > > > I am facing a problem in DEV server that I really have no idea how to > > resolve, which

Why file path and name disappear for Image Field when/after validation

2009-05-23 Thread Stephen Cheng
I suppose that all the fields' value in the form defined in model can be captured and remained when/after you do form validation. My problem is that : 1. When the form is not valid, the filename of image field is gone once you click submit or 2. If I intend to do something else once all fields

Re: Pass context vars to django-registration

2009-05-08 Thread Stephen Cheng
No bother, I have found the solution. Simply use the ContextProcessor. On May 7, 10:27 pm, Stephen Cheng <stephenchengm...@gmail.com> wrote: > I have got a case like this: I have a drop down list of value of 8 > cities which requires a db query every time when every page loads. T

Admin page with my own themes/skins

2009-05-07 Thread Stephen Cheng
I have thought this for quite a while and no idea so far. I like the forms/pages auto generated by Admin engine, but I also want to incorporate some of the forms/pages into my site with following expectations: 1. I can use my own template. 2. use my own template and also use the context

Pass context vars to django-registration

2009-05-07 Thread Stephen Cheng
I have got a case like this: I have a drop down list of value of 8 cities which requires a db query every time when every page loads. The problem is when the url is diverted to django-registration module, then I don't know how to properly pass the citylist as a context value to

distinct for ForeignKey field

2008-10-11 Thread Stephen Cheng
I am wondering how to get distinct values for a ForeignKey field For example: class ModelA(models.Model): . city=models.ForeignKey(City) I understand that I can pass the list to template than probably use regroup and get the group values, but is there a

Re: form submission problem

2008-10-10 Thread Stephen Cheng
Sorry about the silly question. This is resolved. All are documented: http://docs.djangoproject.com/en/dev/ref/forms/validation/#using-validation-in-practice Thanks for your help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: form submission problem

2008-10-09 Thread Stephen Cheng
price))+len(self.clean_title())> 10: raise forms.ValidationError("The length of title plus price should be less than 10 characters") return price class Meta: model=Card On Oct 9, 10:26 pm, Malcolm Tredinnick <[EMAIL PROTECTE

form submission problem

2008-10-09 Thread Stephen Cheng
I defined a field title in model the max length is 30 title=models.CharField("Title",max_length=30) while after I key in none - english characters, eg, Chinese and submit the form, it [database] can only take 10 Chinese characters,otherwise raise an exception. I also use an validation rule in

varible reference in template problem

2008-10-06 Thread Stephen Cheng
Hi django friends I got a problem with varible reference in template. the case is like this: I pass a map to a template, I am trying to get map[key], in the case the key= modelA.id, then I have to use map.modelA.id, then it won't work. How can I conquer this? Can I assign modelA.id to another

Re: Strange:Dev Web server crash with a python.core dump after Admin page being refreshed exactly 16 times

2008-06-01 Thread Stephen Cheng
the process, it's just working fine now :) Hope this help some others. On Jun 2, 12:32 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sun, Jun 1, 2008 at 2:41 AM, Stephen Cheng <[EMAIL PROTECTED]> > wrote: > > > > > > > Hi Guys > > > Thi

How to handle asian language?

2008-06-01 Thread Stephen Cheng
I got exception in admin page when I input chinese character into one field and try to save to db. I am not sure which lib I should install to make it work or any configure I should enable. Any advice? UnicodeEncodeError at /admin/books/author/add/ 'ascii' codec can't encode characters in

Strange:Dev Web server crash with a python.core dump after Admin page being refreshed exactly 16 times

2008-06-01 Thread Stephen Cheng
Hi Guys This is a very strange problem and I haven't resolved it. Dev Web server just crash with a python.core dump and no exception log at all. Problem occurs when you go around the Admin page, either refresh page, add record, delete record. Now I can reproduce it by keeping refresh the admin