Re: Custom model fields not working?

2013-08-06 Thread Oliver Beattie
This was more than 5 years ago… wow! Sorry, I have absolutely no idea now. I would suspect that "yes," I got it sorted, but I would anticipate that the internals of Django's ORM have changed significantly since then, so even if I could remember how I did it, it wouldn't be of much use… Perhaps

Creating a common URL prefix?

2010-10-25 Thread Oliver Beattie
Hi all, I have a bit of an conundrum for you that I'm a little stumped with… I'm wondering whether I'm missing something painfully simple in my search of rather complicated options. Basically, I need a prefix on all URLs (for instance /uk/ or /us/), but I don't want each and every view to have to

Re: Need help in serialization of objects.

2010-02-23 Thread Oliver Beattie
I'm not entirely sure why you'd want to do this, but I'm sure you have your reasons. Probably the best way would be to write your own serializer, which subclasses Django's XML serializer (in django.core.serializers.xml_serializer), and overrides the start_serialization and end_serialization

Re: Switching database backends at runtime?

2009-03-17 Thread Oliver Beattie
Nope, seems this is actually impossible (at least using manage.py shell), since it will load all of the models and hold references to them on initialization until termination, so the settings-definte backend is tied to BaseQuery forever :( On Mar 17, 12:01 pm, Oliver Beattie <oli...@obeattie.

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
You're probably using the tutorial for the development (trunk) version of Django, but you're running 1.0.x — you should be following this tutorial: http://docs.djangoproject.com/en/1.0//intro/tutorial02/#activate-the-admin-site On Mar 17, 1:21 pm, TP wrote: > I have

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
Below that there will be an error. I'm guessing it may be a SyntaxError or NameError, since it looks like you have python after 'mysite.polls' (probably by accident) — that is if that traceback is right. On Mar 17, 12:36 pm, TP wrote: > This relates to the first

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
__unicode__ is called when unicode(ModelInstance) is called. __str__ is called when str(ModelInstance) is called. Internally, if you only define __unicode__, then Django will provide __str__ for you (see http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L277 for the

Re: Switching database backends at runtime?

2009-03-17 Thread Oliver Beattie
sadly bound to using the release version of Django… so will this apply? On Mar 16, 10:25 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Mon, Mar 16, 2009 at 6:20 PM, Oliver Beattie <oli...@obeattie.com> wrote: > > > Does anyone know if it's possible to switch the databa

Switching database backends at runtime?

2009-03-16 Thread Oliver Beattie
Does anyone know if it's possible to switch the database backend in Django at runtime (let's say I want to use dummy for something, but then switch it back to the original after I'm done). Is this possible using django.db.load_backend or something (I'm doubting it as I see there is some

Re: ContentTypes and fixtures

2009-01-30 Thread Oliver Beattie
> Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-)\ Thanking you, I'm not as familiar with the tickets as I should be =) > The best workaround that I can suggest is to include your ContentTypes > in your fixtures. They are dumpable objects, just like everything else > in Django. If your

ContentTypes and fixtures

2009-01-28 Thread Oliver Beattie
Hey everyone, I'm converting some of my stuff over to use Django fixtures instead of the old dump-import a SQL file. This is all going very well, until I realised that my GenericForeignKeys might be broken if I rely on fixtures. In my old SQL method, this was not an issue as I could guarantee

Re: Django + mail server

2008-12-15 Thread Oliver Beattie
http://docs.djangoproject.com/en/dev/ref/settings/#email-host On Dec 15, 7:25 pm, prem1er wrote: > Didn't know about this. Where do I set the EMAIL_HOST parameter? > > On Dec 15, 1:35 pm, "Karen Tracey" wrote: > > > > > On Mon, Dec 15, 2008 at

Can't seem to get Q objects to work as I'd like...

2008-02-08 Thread Oliver Beattie
Hi People, I'm trying to write a query using Q objects but I'm getting incredibly frustrated with them. I'm afraid I don't know SQL so I wouldn't know how to write the queries by hand! The query (using Q objects) I am trying to construct is:- media = media.filter( Q(owner=requester) |

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-12-27 Thread Oliver Beattie
architectures). Then you should be able to run setup.py install with no problems. *Phew!* On Dec 27, 9:07 am, Oliver Beattie <[EMAIL PROTECTED]> wrote: > I have compiled it for > 64-bit:http://farm3.static.flickr.com/2013/2140077639_7abe03b5fb_o.gif > > Yet I still get this e

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-12-27 Thread Oliver Beattie
TED]> wrote: > On Dec 27, 9:49 am, Oliver Beattie <[EMAIL PROTECTED]> wrote: > > > Did anyone ever get this working, I am tearing my hair out here trying > > to figure it out; I finally get it to build and now I'm getting:- > > > ImproperlyConfigured: Error

Re: Passing a dictionary as a query argument?

2007-12-27 Thread Oliver Beattie
I think the pickle modules guarantee that both pickle and cPickle will be able to read each other's pickles, but that's about it. Aside from unpickling every database object on every database query, though, I see no other alternative (aisde from writing my own pickle module [eek]). And thanks

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-12-26 Thread Oliver Beattie
Did anyone ever get this working, I am tearing my hair out here trying to figure it out; I finally get it to build and now I'm getting:- ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Library/ WebServer/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg- tmp/_mysql.so, 2):