working starter API for Work
parent
accffc3b8e
commit
dc54fc1002
|
@ -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'
|
|
@ -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)),
|
||||||
|
)
|
|
@ -105,6 +105,7 @@ INSTALLED_APPS = (
|
||||||
'regluit.core',
|
'regluit.core',
|
||||||
'registration',
|
'registration',
|
||||||
'social_auth',
|
'social_auth',
|
||||||
|
'tastypie',
|
||||||
)
|
)
|
||||||
|
|
||||||
# A sample logging configuration. The only tangible logging
|
# A sample logging configuration. The only tangible logging
|
||||||
|
|
6
urls.py
6
urls.py
|
@ -1,8 +1,14 @@
|
||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
|
from regluit.api.models import WorkResource
|
||||||
|
|
||||||
|
work_resource = WorkResource()
|
||||||
|
|
||||||
|
# (r'^api/', include('regluit.api.urls'))
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
(r'^accounts/', include('registration.backends.default.urls')),
|
(r'^accounts/', include('registration.backends.default.urls')),
|
||||||
(r'^socialauth/', include('social_auth.urls')),
|
(r'^socialauth/', include('social_auth.urls')),
|
||||||
|
(r'^api/', include(work_resource.urls)),
|
||||||
(r'', include('regluit.frontend.urls')),
|
(r'', include('regluit.frontend.urls')),
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue