wlanslovenija / django-tastypie-mongoengine

MongoEngine support for django-tastypie.
Other
73 stars 59 forks source link

Support for TastyPie 0.12.1 and Django 1.7 #81

Closed danstovall closed 9 years ago

danstovall commented 9 years ago

Django 1.7 wasn't compatible with anything before Tastypie 0.12.0. To be able to upgrade to the most recent versions of Django we needed to be able to support versions of tastypie from 0.11.0 and beyond.

The only code changes were to the MonogoEngineResource class. The get_via_url method was The _wrap_polymorphic method would replace the _meta.resource_name with one of the polymorphic resources, and then didn't reset it in the finally statement. We also over-wrote the get_via_url method. In tastypie 0.11.0 the get_via_url didn't use the url resolver, instead it checked the URL directly against the specific resource URLs. This mean that polymorphic resources would return a NotFound or Resolver404 error if the uri provided was one for the polymorphic resources. The get_via_uri method now checks the main resource, and then checks each polymorphic resource in turn to see if the resource can be matched.

danstovall commented 9 years ago

It should be noted that by supporting Django 1.5+, and TastyPie 0.9.12+ there is a possible invalid configuration option. Django1.7 is incompatible with TastyPie 0.10.0. TastyPie 0.10.0 imports django.utils.simplejson, which has been removed in Django 1.7.

danstovall commented 9 years ago

Signed-off-by: Dan Stovall dan.stovall@parentlink.net

mitar commented 9 years ago

Waw, amazing work.

Sadly, I don't have resources anymore to maintain this package. I don't use it in any of my projects anymore and is hard for me to keep up with changes.

Would you be willing to take over maintenance of it and drive it in any direction you think is the best (which Tastypie versions to support, which Django versions to support)? I can give you admin permissions and I will be still around to help if there will be unclear things, but sadly I will not be able to contribute much more.

danstovall commented 9 years ago

I'd be happy to help maintain this project. Thanks.

mitar commented 9 years ago

I just gave you admin rights.

So please prepare a new release then, in any way you see fit, and I can then release it. If there are any others who would like to join the discussion of changes necessary for next version, please join. There are also some other pull requests open, maybe check them as well.

In #68 there is some discussion why currently this package is limited to old mongoengine. There is one edge case for which 0.8 mongoengine fails. One option is to send a patch upstream, or to use a fork of mongoengine with fixed thing. Another is to modify semantic of this package how it behaves with empty values and then we do not depend on old (pre 0.8) behavior of mongoengine, which was broken/changed in 0.8.

danstovall commented 9 years ago

Thanks. I was looking at #68 recently but I thought it was specific to MongoEngine and didn't have anything to do with TastyPie specifcally. MongoEngine hasn't had any movement on that specific issue. It is marked for their 0.9 release but no one has worked on it yet. It was going to be my next project.

I will merge in this pull request and check the others to see if there is anything that can be merged. Then I will prepare a release. Thanks.

mitar commented 9 years ago

I was looking at #68 recently but I thought it was specific to MongoEngine and didn't have anything to do with TastyPie specifcally.

No, it has only with MongoEngine. I miswrote before. I updated my comment above.

mitar commented 9 years ago

I will merge in this pull request and check the others to see if there is anything that can be merged. Then I will prepare a release. Thanks.

Thank you!