diff --git a/setup.py b/setup.py index 9d19f5920..db4b277f6 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,6 @@ url='http://github.com/toastdriven/django-tastypie/', packages=[ 'tastypie', - 'tastypie.representations', 'tastypie.utils', ], package_data={ diff --git a/tastypie/exceptions.py b/tastypie/exceptions.py index 53c19f124..5306d4663 100644 --- a/tastypie/exceptions.py +++ b/tastypie/exceptions.py @@ -18,10 +18,6 @@ class NotFound(TastyPieError): pass -class MultipleRepresentationsFound(TastyPieError): - pass - - class ApiFieldError(TastyPieError): pass diff --git a/tastypie/fields.py b/tastypie/fields.py index 2555528ed..2d7ad9d14 100644 --- a/tastypie/fields.py +++ b/tastypie/fields.py @@ -18,7 +18,7 @@ class NOT_PROVIDED: # All the ApiField variants. class ApiField(object): - """The base implementation of a field used by the representations.""" + """The base implementation of a field used by the resources.""" dehydrated_type = 'string' def __init__(self, attribute=None, default=NOT_PROVIDED, null=False, readonly=False): @@ -64,7 +64,7 @@ def default(self): def dehydrate(self, bundle): """ Takes data from the provided object and prepares it for the - representation. + resource. """ if self.attribute is not None: # Check for `__` in the field for looking through the relation. @@ -350,14 +350,13 @@ def get_related_resource(self, related_instance): def dehydrate_related(self, bundle, related_resource): """ Based on the ``full_resource``, returns either the endpoint or the data - from ``full_dehydrate`` for the related representation. + from ``full_dehydrate`` for the related resource. """ if not self.full: # Be a good netizen. return related_resource.get_resource_uri(bundle) else: # ZOMG extra data and big payloads. - # FIXME: What to do here, since state is no longer maintained? return related_resource.full_dehydrate(related_resource.instance) def build_related_resource(self, value): diff --git a/tastypie/paginator.py b/tastypie/paginator.py index 9e633747e..a320aa2b3 100644 --- a/tastypie/paginator.py +++ b/tastypie/paginator.py @@ -13,7 +13,7 @@ class Paginator(object): (Django) so none of the page-related calculations are necessary. This implementation also provides additional details like the - ``total_count`` of representations seen and convenience links to the + ``total_count`` of resources seen and convenience links to the ``previous``/``next`` pages of data as available. """ def __init__(self, request_data, objects, resource_uri=None, limit=None, offset=0): @@ -24,8 +24,8 @@ def __init__(self, request_data, objects, resource_uri=None, limit=None, offset= May provide ``limit`` and/or ``offset`` to override the defaults. Commonly provided ``request.GET``. Required. - The ``objects`` should be a list-like object of ``Representations``. - This is typically a ``RepresentationSet`` but can be anything that + The ``objects`` should be a list-like object of ``Resources``. + This is typically a ``QuerySet`` but can be anything that implements slicing. Required. Optionally accepts a ``limit`` argument, which specifies how many diff --git a/tastypie/resources.py b/tastypie/resources.py index ff50a3f2d..dc2b2c8b2 100644 --- a/tastypie/resources.py +++ b/tastypie/resources.py @@ -7,7 +7,7 @@ from tastypie.authentication import Authentication from tastypie.bundle import Bundle from tastypie.cache import NoCache -from tastypie.exceptions import NotFound, BadRequest, MultipleRepresentationsFound, InvalidFilterError, HydrationError +from tastypie.exceptions import NotFound, BadRequest, InvalidFilterError, HydrationError from tastypie.fields import * from tastypie.http import * from tastypie.paginator import Paginator @@ -314,7 +314,7 @@ def get_via_uri(self, uri): This needs to be implemented at the user level. This pulls apart the salient bits of the URI and populates the - representation via a ``get`` with the ``obj_id``. + resource via a ``get`` with the ``obj_id``. Example:: @@ -330,7 +330,7 @@ def get_via_uri(self, uri): def full_dehydrate(self, obj): """ Given an object instance, extract the information from it to populate - the representation. + the resource. """ bundle = Bundle(obj=obj) @@ -402,7 +402,7 @@ def hydrate_m2m(self, bundle): if field_object.attribute: # Note that we only hydrate the data, leaving the instance # unmodified. It's up to the user's code to handle this. - # The ``ModelRepresentation`` provides a working baseline + # The ``ModelResource`` provides a working baseline # in this regard. bundle.data[field_name] = field_object.hydrate_m2m(bundle) diff --git a/tests/core/tests/resources.py b/tests/core/tests/resources.py index c5490a618..b48394caf 100644 --- a/tests/core/tests/resources.py +++ b/tests/core/tests/resources.py @@ -208,7 +208,7 @@ def test_determine_format(self): def test__get_available_filters(self): resource = NoteResource() - # Field not in the representation. + # Field not in the resource. borked_filters_1 = { 'foobar': 'all', }