get_query_set() in automatic managers

2009-09-11 Thread filippo
Hey, Django documentation says: "If you override the get_query_set() method and filter out any rows, Django will return incorrect results. Don't do that. A manager that filters results in get_query_set() is not appropriate for use as an automatic manager." http://docs.djangoproject.com/en/1.0//

QuerySet - filter through related objects

2009-09-17 Thread filippo
Hi, Lets say I have models like: class A(models.Model): pass class B(models.Model): t = models.CharField(max_length=100) a = models.ForeignKey('A', related_name="bs") I've found out, that the following query is working: A.objects.filter(bs__t='1').filter(bs__t='2') which returns

problem with django dev server and subprocess.Popen

2007-07-06 Thread Filippo Santovito
Hi all, I'm having a strange problem with a view. Its code runs well if I test if in the shell but seems to block the dev server: #django 0.96 def html2pdf(request, url = None ): from django.http import HttpResponse import subprocess response = HttpResponse(mimetype='application/pdf'

bug in unique_for_year with 0.96?

2007-07-09 Thread Filippo Santovito
I'm trying to use unique_for_year but it seems the Admin simply ignores this constraint: i'm using this model for testing and I'm able to add two entry with the same date: class MyModel(models.Model): class Admin: pass mydata = models.DateField() myfield =

generic relations

2008-06-04 Thread Filippo Santovito
Hi all, I've read http://www.djangoproject.com/documentation/models/generic_relations/ . How can I share a tag between Animal and Vegetables? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p