Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
Hi Raja This looks great. Thanks for helping out. Stepehn On Jun 29, 9:17 pm, Raja wrote: > Setup thecookie.domain attribute value to '.mydomain.com' (The first > dot is important) and all hosts in that domain will get thecookie. > > -- Raja > > On Jun 29, 4

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
ly when the request reaches > the server. > > -- Raja > > On Jun 29, 9:21 am, Stephen Cheng wrote: > > > Hi > > > I am facing a problem in DEV server that I really have no idea how to > > resolve, which is related to cookie variable for subdomains. > > >

subdomains cookie problem

2009-06-28 Thread Stephen Cheng
Hi I am facing a problem in DEV server that I really have no idea how to resolve, which is related to cookie variable for subdomains. I use wildcard subdomains, eg. sub1.abc.com, sub2.abc.com, sub3.abc.com and all sub domains point to one running instance of django app. The problem is that I ho

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 ar

Re: Pass context vars to django-registration

2009-05-07 Thread Stephen Cheng
No bother, I have found the solution. Simply use the ContextProcessor. On May 7, 10:27 pm, Stephen Cheng 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. The > problem is when the url is di

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 variables

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 django-registration

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 ef

Re: form submission problem

2008-10-09 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 Goo

Re: form submission problem

2008-10-09 Thread Stephen Cheng
if len(str(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 <

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 th

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 v

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
ave done or switched on during 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: > > > > > &

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 posi

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

2008-05-31 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 p