Re: Converting a query using extra from Postgres to Mysql

2010-08-25 Thread Federico Capoano
it was simple: locations = Location.objects.filter(category=category.id, status=2).extra( select={'image': 'SELECT locations_images.image FROM locations_images WHERE locations_images.location_id = locations_location.id ORDER BY locations_images.order ASC LIMIT 1' }, ).only('nam

Converting a query using extra from Postgres to Mysql

2010-08-25 Thread Federico Capoano
Hi to all django users, i just completed a project in which I used the extra() database API function in order to save the number of query used. Unfortunately the production server doesn't use Postgres but MySQL. I don't know why but I'm not making it to convert the query so it's compatible with M