straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

Generic view object_list can not generate template names when used with GqlQuery #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This:

def mymodel_list(request):
    query = models.MyModel.gql('WHERE property=:1',1)
    return object_list(request, query)

Results in exception: 'GqlQuery' object has no attribute 'model'

Template name auto-generation when template_name is not passed, does not
work. The quick workaround is:

def mymodel_list(request):
    query = models.MyModel.gql('WHERE property=:1',1)
    query.model = models.MyModel
    return object_list(request, query)

Please patch GqlQuery to provide model.

Original issue reported on code.google.com by janusz.s...@gmail.com on 21 Apr 2009 at 9:21

GoogleCodeExporter commented 9 years ago
Done.

Original comment by wkornew...@gmail.com on 22 Apr 2009 at 9:25

GoogleCodeExporter commented 9 years ago
Thx :)

Original comment by janusz.s...@gmail.com on 22 Apr 2009 at 6:06