tomchristie/django-rest-framework — pull request #472 by ludwigkraatz (2012-12-04 14:49:46+00:00)
Title: View namespace support

Based on "View-Name-Mandatory" i now reimplemented the namespaces.

Added Docs and Tests.

One thing might not be covered:
* if you have a Model Serialized by **HyperlinkedModelSerializer** and
* one serialized field *should* point to some endpoint in another namespace.
* therefore one would need a possibility to set the namespace for every field in the Serializer Options..
* I think this is not necessary. One could easily overwrite this field and then specify the different namespace
* but could be something like
```
getattr(
self.opts, 'view_namespace_lookup', {}
).get(
model_field.name,
getattr(self.opts, 'view_namespace', None)
)
```
at https://github.com/ludwigkraatz/django-rest-framework/commit/f84f256caa92d39fb31e773844851f1bc182ce0b#L1R565

sorry for spamming you with Pull's -- hope this time it looks better and more concrete?
This also covers the view-name-mandatory Pull - so feel free to close that one in case the namespace implementation looks good to you.

One general thing, even if you don't consider this Pull to be for general purpose:
https://github.com/ludwigkraatz/django-rest-framework/commit/28a5b73c250e344d2853869f7710fc383daee8ae#L1R44
The on-the-fly created **serializer_class**'s **Meta** Class when defined a **model_serializer_class** should inherit from **model_serializer_class.Meta** to not loose the options