working starter API for Work

pull/1/head
Raymond Yee 2011-09-12 13:02:06 -07:00
parent accffc3b8e
commit dc54fc1002
4 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,7 @@
from tastypie.resources import ModelResource
from regluit.core import models
class WorkResource(ModelResource):
class Meta:
queryset = models.Work.objects.all()
resource_name = 'work'

11
api/urls.py Normal file
View File

@ -0,0 +1,11 @@
from django.conf.urls.defaults import *
from tastypie.api import Api
from regluit.api import models
api = Api()
api.register(models.WorkResource())
urlpatterns = patterns('',
# The normal jazz here...
(r'^api/', include(api.urls)),
)

View File

@ -105,6 +105,7 @@ INSTALLED_APPS = (
'regluit.core',
'registration',
'social_auth',
'tastypie',
)
# A sample logging configuration. The only tangible logging

View File

@ -1,8 +1,14 @@
from django.conf.urls.defaults import *
from regluit.api.models import WorkResource
work_resource = WorkResource()
# (r'^api/', include('regluit.api.urls'))
urlpatterns = patterns('',
(r'^accounts/', include('registration.backends.default.urls')),
(r'^socialauth/', include('social_auth.urls')),
(r'^api/', include(work_resource.urls)),
(r'', include('regluit.frontend.urls')),
)