I just found out that get() returns only one object.
On Nov 19, 2:30 pm, neridaj wrote:
> Thanks for the help. Is get_object_for_this_type() not made to handle
> multiple objects? If more than one object is returned I get this
> error: get() returned more than one Entry.
>
> On Nov 19, 4:10 am, D
Thanks for the help. Is get_object_for_this_type() not made to handle
multiple objects? If more than one object is returned I get this
error: get() returned more than one Entry.
On Nov 19, 4:10 am, David De La Harpe Golden
wrote:
> Karen Tracey wrote:
> > Undocumented internal routine, but unlike
Karen Tracey wrote:
> Undocumented internal routine, but unlikely to change:
>
Just to note the contenttypes framework has a documented way:
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#methods-on-contenttype-instances
from django.contrib.contenttypes.models import ContentType
Thanks Karen but I'm just getting a 'NoneType' object has no attribute
'objects' with this code:
def search(request):
query = request.GET.get('q', '')
model = request.GET.get('models', '')
model_class = get_model(blog, model)
results = []
if query:
results = model_class
On Wed, Nov 18, 2009 at 9:09 PM, neridaj wrote:
> Hello,
>
> I have a select menu which I would like to use as a model selector in
> a view but I keep getting 'unicode' object has no attribute 'objects'
> because I need to cast this to type Model or something similar. How do
> I go about doing th
Hello,
I have a select menu which I would like to use as a model selector in
a view but I keep getting 'unicode' object has no attribute 'objects'
because I need to cast this to type Model or something similar. How do
I go about doing that.
Thanks,
J
--
You received this message because you ar
6 matches
Mail list logo