Re: Django foreing keys joins

2013-06-08 Thread Àlex Pérez
rlying > id field for faster testing: > > >>> print Counter.on_medicos.filter(loc_id__isnull=True).only('id').query > > That should return what you might have been expecting. > > -- > > Jani Tiainen > > "Impossible just takes a little longer" >

Django foreing keys joins

2013-06-05 Thread Àlex Pérez
Can someone tell me why the or in that query: print Counter.on_medicos.filter(loc__isnull=True).only("id").query ""SELECT `web_counter`.`id` FROM `web_counter` LEFT OUTER JOIN `locations_localidad` ON (`web_counter`.`loc` = `locations_localidad`.`id`) WHERE (`web_counter`.`mode` = 1 AND

Re: ORM Prefetch related and only()

2013-05-29 Thread Àlex Pérez
) otro = OtherManager() Especialidad._default_manager = Especialidad.otro tpl_vars["list"] = list(tpl_vars["list"]) Especialidad._default_manager = Especialidad.objects Thank's! 2013/5/29 Christophe Pettus <x...@thebuild.com> > > On May 29, 2013, at 12:44 PM

Re: ORM Prefetch related and only()

2013-05-29 Thread Àlex Pérez
Ok thank's!!! but you thinks thats the normal behaviour? this could be included in future versions of the orm? You know the way to simulate the behaviour that i want.? 2013/5/29 akaariai > There is no way to alter the behavior of prefetch_related. It fetches > the related

ORM Prefetch related and only()

2013-05-29 Thread Àlex Pérez
I want to know if there is a way that the query that is executed to get the prefetch related information can get only certains values, actually that only works for select_related, May be i have done something wrong but the prefetch_related query is getting all the fields of the model. Someone

Concat on Update

2012-12-28 Thread Àlex Pérez
Hello, Someone know how to do that in django?: url = "basE_url" query.update(url= url + models.F("slug_nombre")), and the result should be the concatenation of de column url like "basE_url(slug_nombre)" I'm a little bit confused, because I understand why doesn't work that, but don't know why

csrf protection question

2012-10-23 Thread Àlex Pérez
I have override the CsrfViewMiddleware middleware by: class CustomCsrfViewMiddleware(CsrfViewMiddleware): def process_response(self, request, response): if getattr(response, 'csrf_processing_done', False): return response # If CSRF_COOKIE is unset, then

csrf cookie and varnish

2012-10-15 Thread Àlex Pérez
Today I had a problem with CSRF protection of Djando and varnish, the varnish basically detects that a cookie (the CSRF) and does not perform its task (cache requests). The solutions found on google have not convinced me. And I tried an idea, delete all cookies when I'm not on a website that

Re: union of two QuerySets

2012-08-01 Thread Àlex Pérez
Hi, it's better Person.objects.filter(models.Q(first_**name__startswith='mic'), models.Q(first_**name__startswith='joh')) (only one query...) 2012/8/1 Robin Pedersen > On Monday, December 11, 2006 4:37:25 AM UTC+1, Rares Vernica wrote: >> >> Hi, >> >> What is a way to

ContentType and multiple database

2012-08-01 Thread Àlex Pérez
Hello, I want to take objects of another project that i don't have installed. I can have the contenttype of the external object but I can't take the object I understand that, take the object remotly of a model thah you dosen't have have the class is not possible (I think...) but if i want only a

Re: Handling millions of rows + large bulk processing (now 700+ mil rows)

2012-07-01 Thread Àlex Pérez
+1 2012/7/1 s > Great > On Jun 30, 2012 6:10 PM, "Cal Leeming [Simplicity Media Ltd]" < > cal.leem...@simplicitymedialtd.co.uk> wrote: > >> Hi all, >> >> As some of you know, I did a live webcast last year (July 2011) on our >> LLG project, which explained how we overcome

Re: How do I get django working without having to manually run the server?

2012-06-17 Thread Àlex Pérez
One question, The automatic reload whenever you modify the files. There are an alternative to do that with mod_wsgi? or anything else? Thanks! 2012/6/17 Kurtis Mullins > I did forget one important (and very useful feature) that the runserver > contains -- the

Re: How can i transmit an objects in list?

2012-06-14 Thread Àlex Pérez
Hello, Are you sure? I suppose that "childrens" is a custom manager, can you show us, the implementation of that manager? Only for performance "if len(category.childrens.all()):" -> "if category.childrens.exist():" But your problem, it's rare. Print the type of the firs element of the result

Re: Sorl thumbnails VS Google

2012-06-05 Thread Àlex Pérez
Hello, You can change the name of the files generated by sorl and be sure that the name that you are giving to the image is unique, and if not, make a new name, you can find information about that locking the code: https://github.com/sorl/sorl-thumbnail/blob/master/sorl/thumbnail/base.py#L32