Django-ROA models appearing as `NoneType`

Anonymous avatarAnonymous created an issue

I have a simple model:

from django.db import models
from django_roa import Model

class RemoteModel(Model):
    slug = models.CharField(max_length=255, blank=True, null=True)

    @staticmethod
    def get_resource_url_list():
        return u'http://my-restful-url/path/resource'

...and here are the relevant portions of my settings.py:

INSTALLED_APPS = (
    'django_roa',
    'myapps',
    # ... other default apps ...
)

# ROA Stuff
ROA_MODELS = True
ROA_FORMAT = 'json'
ROA_DJANGO_ERRORS = True
ROA_HEADERS = {
    'ApiKey': 'apikey'
}

However, when I go to test out this example, this happens...

>>> from myapps.models import RemoteModel
>>> RemoteModel.objects.all()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'objects'
>>> type(RemoteModel)
<type 'NoneType'>

Is this a bug? It's nearly identical to the example twitter app.

(Cross-posted from StackOverflow: http://stackoverflow.com/questions/19417650/creating-a-simple-remote-model-using-django-roa)

Comments (0)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.