Re: ANN: PyMySQL 0.3

2010-09-29 Thread Bo Shi
The following patch to your application's manage.py will allow you to use pymysql without patching Django. #!/usr/bin/env python +try: +import pymysql +pymysql.install_as_MySQLdb() +except ImportError: +pass + On Sep 10, 12:25 pm, Andy wrote: > On Sep 10, 11:18 am, Andy Dustman wro

Re: manage.py test without using a database?

2009-01-05 Thread Bo Shi
Thanks Russell, the former works great (I was hoping, in my infinite laziness, that there was an undocumented command line switch :-P). Regards, Bo On Jan 1, 1:50 am, "Russell Keith-Magee" wrote: > On Wed, Dec 31, 2008 at 7:08 AM, Bo Shi wrote: > > > Hi, > > >

manage.py test without using a database?

2008-12-30 Thread Bo Shi
Hi, One of our django applications does not use django's ORM. Is there a way to run ./manage.py test my_app Such that it does not perform test database setup? Thanks, Bo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: Getting HTTP header data in templates

2007-01-22 Thread Bo Shi
I think request.META is what you're looking for, i.e.: referrer = request.META.get('HTTP_REFERER', '/') On Jan 22, 9:39 am, "Andy Dustman" <[EMAIL PROTECTED]> wrote: > I have a 404 page that I would like to display some of the HTTP > headers (particularly HTTP_REFERER) in so that user receivi

sqlite3, QuerySet.extra() and order_by() inconsistencies between Python versions

2007-01-12 Thread Bo Shi
Hi - Has anyone else observed differences between the behavior of order_by between Python 2.3 and 2.4? Under 2.3, the following code drops many items in thread_list when using order_by(): ... extra_last_updated = """ SELECT date FROM forum_post WHERE forum_post.threa

Strange admin sqlite3 read error

2006-09-13 Thread Bo Shi
Hi All - The background: I'm using SVN trunk with sqlite3, and can't access the admin page due to a write-error on the database ("OperationalError: attempt to write a readonly database"). I've attempted a number of permissions changes (even doing a temporary chmod 777) on the database file with

Admin "Page Not Found" Part 2

2006-06-14 Thread Bo Shi
This is a continuation of the following thread: http://groups.google.com/group/django-users/browse_thread/thread/13a94a5ac9b5ff8a/f6fbcdd419ddf89e?q=page+not+found&rnum=1#f6fbcdd419ddf89e I'm experiencing the same problem; I've fiddled with permissions (superuser/explicitly setting all permissio

Re: Puzzling META.unique_together issue

2006-03-03 Thread Bo Shi
Sorry - some edit_inline, etc. got cut off in the paste. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from t

Puzzling META.unique_together issue

2006-03-03 Thread Bo Shi
Hi, three models that concern this issue are Photo, Tag, and PhotoTag. Tag represents the model for all tags: class PhotoTag( meta.Model ): tid = meta.ForeignKey( Tag, core = True ) pid = meta.ForeignKey( Photo, core = True, verbose_name = "Photo Tag", edit_ class META: # fol

Re: File Upload Issue

2005-10-16 Thread Bo Shi
Hey Nesh, Moving the rename logic to _pre_save() would be the best way of doing things but I have a problem where I rename the uploaded file into one based on it's primary key. While in _pre_save(), self.id is None, so is there a way to access the value that will become the primary key? Bo

File Upload Issue

2005-10-15 Thread Bo Shi
Hi All, I've been playing with FileField and file uploading. I do have a problem that I can't seem to solve; when a file gets uploaded, it is placed in the media directory under some random filename the client was using. I would like to normalize this filename so that foo.txt is saved on the