Re: form validation does not work

2008-12-31 Thread Chuck22
6 pm, Daniel Roseman wrote: > On Dec 31, 12:18 am, Chuck22 wrote: > > > > > > > class ContactForm(forms.Form): > >           email = forms.EmailField(required=True, > >                              widget=forms.TextInput(attrs= > > {'size&#x

Re: form validation does not work

2008-12-31 Thread Chuck22
that required field did not validate and block the form submission. User is able to submit the form without providing email which is a required field. On Dec 31, 1:50 am, "Alex Koshelev" wrote: > Please post here entire view code > > > > On Wed, Dec 31, 2008 at 8:18

form validation does not work

2008-12-30 Thread Chuck22
class ContactForm(forms.Form): email = forms.EmailField(required=True, widget=forms.TextInput(attrs= {'size':'30'}), error_messages={'required':'Please fill out your Email'}) ... in my form html file: ... label for="id_f

Re: where are the code that handle image file upload in Django admin page?

2008-12-22 Thread Chuck22
Anyone can help on this? I get stuck with image file upload. On Dec 21, 11:33 pm, Chuck22 wrote: > I have three ImageField in my form and model, I want to know how to > upload the three image files in the form processing code. I found > Django Admin page handles the image file uplo

where are the code that handle image file upload in Django admin page?

2008-12-21 Thread Chuck22
I have three ImageField in my form and model, I want to know how to upload the three image files in the form processing code. I found Django Admin page handles the image file upload nicely. And I want to do the exactly same work. But I can not find the piece of code that does the job when searchin

Re: image uploading, validation by using form

2008-12-21 Thread Chuck22
t; image.') > >             if len(thumbnail_image) > 20480: #bytes >                 raise forms.ValidationError(u'Thumbnail file size must > not exceed 20 KB.') > >         except AttributeError: >             pass > >         return thumbnail_image >

image uploading, validation by using form

2008-12-20 Thread Chuck22
Here is my model: class Book(models.Model): title = models.CharField(max_length=150) category = models.CharField(max_length=50) description = models.CharField(max_length=2000) image1 = models.ImageField(upload_to='img/bk', blank=True) image2 = models.ImageField(upload_to='img/

Is there GUID available in Django or Python?

2008-12-16 Thread Chuck22
1. I want to create Global Unique ID (GUID) as the primary key of my database table. Is there GUID available in Django or Python? 2. Also, I need to create a Authorization Code (random char/number string) to verify user's email when people sign up on my site. Is there generic method in Django or

Re: mod_python setup on Apache virtual host

2008-11-18 Thread Chuck22
After adding "homedomain" subdirectory (project root folder) to the Python path, it is working now. PythonPath "[r'C:/Apache',r'C:/Apache/homedomain'] + sys.path" Thank for giving me the right direction. > Check your Python path to make sure it includes the parent directories > of everything yo

Re: mod_python setup on Apache virtual host

2008-11-15 Thread Chuck22
Because my application works fine with Django development server (http://locahost:8000) on the same machine, I assume the problem does not reside in my application code. Then it must be due to the configuration of Apache. Do I need to modify my code to make it work with Apache/mod_python? Here is

Re: mod_python setup on Apache virtual host

2008-11-15 Thread Chuck22
ov 16, 6:12 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > Are you setting ErrorDocument directives in Apache configuration? > > If you are then disable them and then actual error may not be masked. > > Have you looked in Apache error log for more information? &

Re: mod_python setup on Apache virtual host

2008-11-15 Thread Chuck22
Here is what I tried. DocumentRoot "C:/Apache/homedomain" ServerName domain.com ServerAlias www.domain.com SetEnv DJANGO_SETTINGS_MODULE homedomain.settings SetHandler mod_python PythonHandler django.core.handlers.modpython PythonPath "['C:/Apache'] + sys.path" P

Re: admin home page shows no permission to do anything

2008-10-30 Thread Chuck22
Never mind. I found the solution. Put admin.autodiscover() to urls.py fix the issue. On Oct 30, 9:40 pm, Chuck Bai2 <[EMAIL PROTECTED]> wrote: > I got the following message when login as superuser to admin home page: > * > You don't have permission to edit anything. > * > > Recent Actions > >

Re: render_to_response failed to render media files in base.html

2008-10-20 Thread Chuck22
Adding context_instance=RequestContext(request) to the method fixed the problem. Seems this should be done by default for render_to_response method. Thank you. On Oct 20, 4:36 am, Christian Joergensen <[EMAIL PROTECTED]> wrote: > Chuck Bai2 wrote: > > Here is my view code: > > > def contact(requ

Re: makemessages create invalid msgid in django.po file

2008-10-13 Thread Chuck22
Thanks, Karen. You are correct. My version is Win32 binaries of GNU gettext-runtime 0.13.1. It seems getting the development trunck is a better choice for me. But, I am not sure if the Django development trunck is stable enough to use. I will give it a try. > > You don't mention your system type

Re: change i18n language through hyperlinks

2008-10-11 Thread Chuck22
thanks Satheesh, the set_language function is partially working for me. When I click the lauguage hyperlinks, only the word "Home" works, but when I change the msgid to be "Home1", it stop working. It seems that "Home" is a django preserved word which get auto-translated. 1. In my base.html, I ha

Re: unable to resolve URL in template

2008-09-28 Thread Chuck22
Anyone has any clue? The problem has not been resolved yet. Any referrence are welcome. Thanks. chuck On Sep 27, 2:21 pm, Chuck Bai <[EMAIL PROTECTED]> wrote: > In my url.py, I define the root my site is like this: > urlpatterns = patterns('', >     url(r'^$', 'views.index', name="index"), >