Re: Best way to unique upload file name

2009-01-26 Thread chatchai
the same (name) file. Thanks and regards, Chatchai On Jan 27, 11:57 am, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Mon, 2009-01-26 at 20:52 -0800, chatchai wrote: > > [...] > > > I know that Django will append the underscore after the file name > > until th

Re: Best way to unique upload file name

2009-01-26 Thread chatchai
On Jan 27, 11:44 am, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Mon, 2009-01-26 at 20:39 -0800, chatchai wrote: > > Hi, > > > I want to unique upload file and there is not unique parameter > > available for file field model. I think I can do this at

Best way to unique upload file name

2009-01-26 Thread chatchai
Hi, I want to unique upload file and there is not unique parameter available for file field model. I think I can do this at the form level but I just want to make sure if it is the best way to go. Any comment or example is welcome. Thanks, Chatchai

Re: 'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread Chatchai Neanudorn
port.' >return render_to_response('shiftmanager/ > packagingreport_details.html', {'form': form, 'messages': messages, > 'errors': errors}) > > > The context form is a PackagingReport Object > > On Nov 27, 9:51 am, "Chatchai Neanudorn" <[EMAIL PROTECTED]> wrote: >

Re: 'str' object has no attribute '_meta' while using comment system

2008-11-26 Thread Chatchai Neanudorn
{% get_comment_count for *form *as comment_count %} make sure you put the right object (in your code is form, what is it? do you have template context names form?) for comment templatetag and it is available chatchai 2008/11/27 izzy <[EMAIL PROTECTED]> > > Hi all. > >

Re: Moving django site from linux to windows

2008-11-19 Thread Chatchai Neanudorn
Hi, Try this, http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer Hope this help Chatchai 2008/11/19 seperelli <[EMAIL PROTECTED]> > > Dear, > I have a site that is working with django,mysql,phyton on a linux > system. > This site should be put on a win

Getting the most comment for integer id object

2008-11-17 Thread chatchai
Hi, I have a integer id model and I want to get the most comment (django.contrib.comments) for the model. I use postgres and I got the error about comparing integer(my model) and text (comment object_pk). Someone have any solution? Thanks, Chatchai

Re: How to get comment_count in view?

2008-11-02 Thread Chatchai Neanudorn
from django.contrib.comments.models import Comment from post.models import Post #get comments for model Comment.objects.for_model(Post).count() #get comment for instance Comment.objects.for_model(Post.objects.get(id=1)).count() 2008/11/2 David.D <[EMAIL PROTECTED]> > > I can get comment_count

Django Hangman

2008-10-02 Thread chatchai
Hi all, I have built Hangman game using Django. You can see it at http://feedfrog.net/app/hangman If anybody interest in its code, please contact me. Enjoy :) Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Customizing new comment

2008-09-14 Thread chatchai
e.com/blank.png"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_channel = "8427791634"; google_color_border = "FF"; google_color_bg = "FF"; google_color_link = "006792"; google_color_url = "

Re: Template inherite and direct_to_template

2008-08-26 Thread Chatchai Neanudorn
Yes, it looks like *extra_context *is not* *available for rendering. Don't know how to fix, finally use templatetag to do this task. Thanks, Chachai 2008/8/27 Malcolm Tredinnick <[EMAIL PROTECTED]> > > > On Tue, 2008-08-26 at 07:10 -0700, chatchai wrote: > > Hi ,

Re: Template inherite and direct_to_template

2008-08-26 Thread chatchai
FYI, it works if I use templatetag to get the queryset. chatchai wrote: > Hi , > > It's not easy to explain so please look at codes below, > > #url.py > base_context = { > 'books' : Book.objects.all(), > } > > urlpatterns = patterns('', > (r'^$', di

Template inherite and direct_to_template

2008-08-26 Thread chatchai
ook detail page only render the Books but not the book list. So, Can I use direct_to_template and extra_context to do this task? Is something go wrong? Any clue? Thanks, Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: Django + tiny_mce

2008-07-08 Thread Chatchai Neanudorn
Ok, Got you. Where is retrun code for /tiny_mce/tiny_mce.js<http://192.168.1.4:8000/tiny_mce/tiny_mce.js>itself, Did you mean all js under /tiny_mce cannot be loadded by django? What is environment you are working on? 2008/7/9 Chatchai Neanudorn <[EMAIL PROTECTED]>: > http://1

Re: Django + tiny_mce

2008-07-08 Thread Chatchai Neanudorn
http://192.168.1.4:8000/tiny_mce/tiny_mce.js vs [08/Jul/2008 19:37:23] "GET /tiny_mce/langs/en.js HTTP/1.1" 404 1771 What is "lang" at the right side? Chatchai 2008/7/9 LRP <[EMAIL PROTECTED]>: > > Hi, > > Thanks to all for responses, but puzzle pers

Re: Django + tiny_mce

2008-07-06 Thread Chatchai Neanudorn
account. For another media, I use, * DIR = os.path.dirname(__file__)* *MEDIA_ROOT = os.path.join(DIR, 'static') MEDIA_URL = 'http://feedfrog.net/static/' httpd.conf Alias /static /home/meledictas/webapps/django/meledictas/static* I use this for all of my django site. Have a nice day. Chatchai

Re: Django + tiny_mce

2008-07-06 Thread Chatchai Neanudorn
/tiny_mce.js&quot</a>;> http://mymedia.com/js</a> /tinymce/www/textareas.js" This can apply to css as well. Hope this help, Chatchai 2008/7/6 <[EMAIL PROTECTED]>: > Hello, > > I'm working through James Bennett's Practical Django Projects. Have brought > up

Using template_utils to get latest modified object.

2008-06-29 Thread chatchai
If I have a 'modified' filed like this, modified = models.DateTimeField(auto_now=True) The question is, How to setup the GENERIC_CONTENT_LOOKUP_KWARGS to get latest object for model using get_latest_ovject template tag. Thanks --~--~-~--~~~---~--~~ You

Re: Support for MS SQL Server

2008-06-24 Thread Chatchai Neanudorn
http://www.feedfrog.net/blog/2008/may/29/using-ms-sql-django/ Hope this help, Chatchai 2008/6/25 Russell Keith-Magee <[EMAIL PROTECTED]>: > > On Wed, Jun 25, 2008 at 7:03 AM, Nagu <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > After doing some search

Re: Django test Client problems

2008-06-13 Thread Chatchai Neanudorn
ss you may need to do the same thing. Hope this help. Chatchai 2008/6/13 shabda <[EMAIL PROTECTED]>: > > I have some code like this, > > c = Client() > client.get('/myurl/') > > where '//myurl' calls view function, > > def foo(request): > ip_addrs = request

Re: ASP.Net GridView Equivalent in Django

2008-06-05 Thread Chatchai Neanudorn
want, with your way. Regards Chatchai 2008/6/5 Brian Victor <[EMAIL PROTECTED]>: > > Ian wrote: > > I have started looking at Django and was wondering if there is a > > widget equivalent to ASP.Net's GridView in terms of richness of > > functionality. &g

Re: django-tagging problem

2008-05-28 Thread Chatchai Neanudorn
}}{% if not forloop.last %}, {% endif %} {% endfor %} {% endif %} Hope this help, Chatchai 2008/5/28 mwebs <[EMAIL PROTECTED]>: > > Hi Alex, > > I was trying to use this, but I got an no-attribute-tag-field-error... > I also tried tagging.TagField() and models.TagField() &g

Re: How to determine server?

2008-05-13 Thread Chatchai Neanudorn
> before I have a request object to look at? > > On May 12, 6:56 pm, "Chatchai Neanudorn" <[EMAIL PROTECTED]> wrote: > > mod_python (django.core.handlers.modpython), > > > > request.META['GATEWAY_INTERFACE'] = 'CGI/1.1' > &

Re: How to determine server?

2008-05-12 Thread Chatchai Neanudorn
, Chatchai 2008/5/13 Bob <[EMAIL PROTECTED]>: > > I'd like to find out whether I'm running under the Django development > server or mod_python. How can I do this? > > > --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Code works with Django's server, but not with Apache+mod_python?

2008-05-05 Thread Chatchai Neanudorn
When I installed my web at webfaction I did this to see which module python use, at settings.py import os import django, PIL logfile = open('path.log', 'w') django_path = django.__file__ pil_path = PIL.__file__ logfile.write('django - %\n pil - %s\n' % (django_path, pil_path)) logfile.close()

Re: Django failed to parse quote URL.

2008-04-30 Thread chatchai
viron['PATH_INFO']) I change it to, self.path = force_unicode(environ['PATH_INFO'], encoding=settings.DEFAULT_CHARSET) It works properly. Any comment? Chatchai On Apr 30, 9:12 pm, chatchai <[EMAIL PROTECTED]> wrote: > Hi, > With Django trunk version, when make a web request w

Django failed to parse quote URL.

2008-04-30 Thread chatchai
25\lib\site-packages\django\utils\encoding.py", line 60, in force_unicode raise DjangoUnicodeDecodeError(s, *e.args) DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xa1 in position 1: unexpected code byte. You passed in '/\xa1/ ' () Is it normal or something wrong? Thanks Chatch

Unicode slug?

2008-04-29 Thread chatchai
url like this, r'^post/(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(? P[\-\d\w]+)/$' It work well (with slug.encode) but not all case. I mean, some characters produce error. What is the best way to deal with this thing? Or just use something instead (translate slug to ascii, numeric?) Regards Chatchai

Re: Django voting with jellyrool

2008-04-26 Thread Chatchai Neanudorn
{% endif %} {% endfor %} Umm, it look complicate** and ugly? Regards * 2008/4/27 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > What exactly is your problem? Is latest_items empty in the template? > > On Apr 26, 2:10 am, chatchai <[EMAIL PROTECTED]> wrote: > > Hi all,

Django voting with jellyrool

2008-04-26 Thread chatchai
%} {% get_latest_objects aggregate.item 10 as latest_items %} I try to access voting for post in latest_items and cannot find any solution. Any idea is my appreciated. Thanks Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Adding new language for i18n

2008-04-25 Thread Chatchai Neanudorn
Thanks for opening a ticket. Regards 2008/4/25 TMihai Damian <[EMAIL PROTECTED]>: > > Ticket opened here: > > http://code.djangoproject.com/ticket/7084 > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Weblog archive links are bad

2008-04-24 Thread Chatchai Neanudorn
Hi, You can pass "allow_empty=True" to generic views in case of you don't like 404. Cheer Chatchai 2008/4/24 David Reynolds <[EMAIL PROTECTED]>: > > > On 21 Apr 2008, at 10:14 pm, Jon Lesser wrote: > > > It seems that if there are no entries for a part

Re: Adding new language for i18n

2008-04-24 Thread Chatchai Neanudorn
Yes, it seem to be problem only on Window environment. I asked my friend to run command under Linux. It works fine. Cheers. Chatchai 2008/4/24 Mihai Damian <[EMAIL PROTECTED]>: > > Not shure yet but this could be a Windows only issue. I'll get back > later

Django photo application reviewing

2008-04-24 Thread chatchai
I post about photo management application for Django. You can put your comment here. http://meledictas.bashell.com/blog/2008/apr/24/reviewing-django-photo-album/ Regards Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Adding new language for i18n

2008-04-15 Thread chatchai
Hi, Malcolm, I added settings and it didn't work so I force it... :D For now, I try to completely start adding new language by executing make-messages.py -l th under django path. I got this error, C:\Python25\Lib\site-packages\django>make-messages.py -l th processing language th errors

Re: Authentication expiration time

2007-06-17 Thread Chatchai Neanudorn
Rob You can control cookie expiration by setting SESSION_COOKIE_AGE. Default value is 2 week (1209600 seconds). You can try 'remember' user login by closing browser without clicking 'Log out' button. Nex time your visite that page, you can access it without re-login. For security

Django uploading framework vs tramline

2007-01-30 Thread Chatchai Neanudorn
Hi Are there comparing performance of uploading between django itseft and tramlime. What is the best way, installation and proformace are subject of comparing. Thank Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed

HTTP REQUEST/RESPONSE

2007-01-29 Thread Chatchai Neanudorn
I need to know what is structure of request/response create by django. How to capture or are there any tools to see what request and response is? Thank chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Http request

2007-01-22 Thread Chatchai Neanudorn
= urllib.urlencode({'name':name, 'file': file.read()}) file.close() #tranmitt it f = urllib.urlopen("http://127.0.0.1:8000/test/",data) #read response f.read() #close connect f.close() Regards chatchai --~--~-~--~~~---~--~~ You received this message b