tryolabs / django-tastypie-extendedmodelresource

An extension for TastyPie's ModelResource, to allow features such as easily having multiple nested resources.
https://tryolabs.com
44 stars 14 forks source link

AttributeError: urls when running example code #2

Open dungtn opened 12 years ago

dungtn commented 12 years ago

Hi team,

This error happened when api objects try to append 'Resource' urls to pattern_urls: https://github.com/toastdriven/django-tastypie/blob/master/tastypie/api.py#L98 while ExtendedModelResource's object has no attribute "urls"

I traced through the ExtendedModelResource initial process and see there's no update call for "base_fields" in ExtendedDeclarativeMetaclass which result the new_class.base_fields has only "redirect_url" attribute. And since Resource.init just make a deep copy from "base_fields" to "fields", the newly created object has no attribute "urls".

I would like to fix that, but I'm not certain about what should be updated to the "base_fields". Please give some feedback :)

henward0 commented 11 years ago

Hello - I have run into the same problem. Has there been a fix for it?

mounirmesselmeni commented 11 years ago

Hi, I have the same problem. Can you fix that ?