Re: distinct() ?

2010-07-21 Thread jaymzcd
"I've solved the problem by passing the returned dictionary through my own distinct() function which strips out duplicates." Don't roll your own implementations unless you actually really need to! It's bad practise and can introduce added complexity to your solution. The .distinct() call will work

Re: Plese guide to solve this

2010-07-21 Thread jaymzcd
I'm going to guess you have been following along with the http://www.djangobook.com/ site. It was great in the day but *do not use that* now-a-days as it covers 0.96. There have been significant changes, one of which is the maxlength to max_length on CharFields. Stick with the particular version y

Re: distinct() ?

2010-07-21 Thread jaymzcd
I'm guessing your Members model is referencing the User model? Check the ordering as related models will influence your distinct. If your Members model has its own ordering that will also come into effect even though your picking your value out explicitly: "If you order by fields from a related mo

Re: URL to specify when accessing subdomains using Django

2010-07-20 Thread jaymzcd
how to use it either. > > > Thank you for all the help all of you have given me so far. > > > Yours sincerely, > > Nanda > > > On Jul 19, 3:00 pm,nandu wrote: > > > > Thank you to all whohave replied. > > > > I will give the sites framework an

Re: should i use django

2010-07-19 Thread jaymzcd
y have to throw away the way they "normally" code. It's one of the reasons I enjoy using python for web apps, we write a lot of code here that has crossover use so we can take that same code and adapt it for other internal projects here. Good luck! On Jul 19, 10:45 pm, jaymzcd wro

Re: should i use django

2010-07-19 Thread jaymzcd
If you dont really need to do anything web specific bar displaying some XML you could use something like cherrypy - its a python framework for building web apps very much from the ground up. That said, it's so easy to use django to handle a few urls and it won't add much overhead so it's a fine cho

Re: URL to specify when accessing subdomains using Django

2010-07-19 Thread jaymzcd
Like Daniel & Steve have said already, urls.py only deals with the path component of the URL, not the domain. The sites framework is what you need to use, its pretty simple. All you really need to do is something like: 1. in urls.py match the URL you want that is common for both subdomains 2. in y

Re: Apache, wsgi and templates

2010-07-15 Thread jaymzcd
There's a few ways to do it. An easy way if your just serving up some css, images etc is to symlink your admin_media folder in your media directory to the media folder in your django admin install: [ja...@293230-app1 ~]$ ls /var/django-projects/udox/public/media/ -l total 28 lrwxr-xr-x 1 root ro

Re: How to handle Jaywalking - parsing a comma-delimited value in field and do lookups (1,4,5,6...)

2010-07-14 Thread jaymzcd
One idea that springs to mind is to add a property method to your model that returns that self.group field as a list. With that list you could add another property that returned all the actual group items. Then write a custom admin view for add/change/view of that model which works with the group i

Re: Comparing DateTimeField to datetime.now()

2010-07-14 Thread jaymzcd
This code works fine for me: In [1]: from gallery.models import Gallery In [2]: g = Gallery.objects.all()[0] In [3]: g.created_at Out[3]: datetime.datetime(2010, 4, 1, 7, 11, 51) In [4]: import datetime In [5]: n = datetime.datetime.now() In [6]: g.created_at > n Out[6]: False In [7]: [g.created_a

Re: Django Install - Won't Import?

2010-07-14 Thread jaymzcd
Sounds like you're quite new to all this. If I was you I'd install setuptools for windows, it'll make adding packages a lot easier for you. http://thinkhole.org/wp/2007/02/01/howto-install-setuptools-in-windows/ The "setup.py install" command, you should have "python" before that so it actually ex

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread jaymzcd
Hi Heleen, I think this is because your running the users through an intermediate model. That changes the way you need to work with the M2M data. You should be working on the Permission model/objects instead. If you check out the M2M docs for models via an intermediate: http://docs.djangoproject.

Re: Managing static content / basically handling images best practices

2010-07-14 Thread jaymzcd
I typically add a config to apache to ignore my media folder and not handle it with python so that requests to /media/.* all go straight to the webserver and don't go via django. I typically have something like this sitting in my conf's: SetHandler None Options -Indexes I

google blogger & ooyala video integration (apps)

2010-07-14 Thread jaymzcd
int I feel I can share them. Blogger: http://github.com/jaymzcd/django-blogger Ooyala: http://github.com/jaymzcd/django-ooyala More info on both: http://jaymz.eu/2010/07/integrating-ooyala-in-django-or-in-general/ http://jaymz.eu/2010/06/google-blogger-to-django-integration/ Cheers, jaymz --

android app for the documentation site

2010-05-28 Thread jaymzcd
Hi All, I thought some of you with android phones might be interested, I knocked up a quick app to make browsing the doc site a bit easier for me. It's in the marketplace for download. It's got some quick links to topics I tend to lookup a lot. I was thinking of adding in custom bookmarks and snip

django developer position in london

2009-06-30 Thread jaymzcd
Hi all, I'm a developer at u-dox.com, we run a number of sites such as spinemagazine.com & crookedtongues.com and have quite a few development jobs lined up and are now looking for a full time developer for interview. The job spec is below. If anyone is interested you can mail either myself (ja..