from django.conf.urls.defaults import patterns, url, include

from surlex.dj import surl

from .api import ProjectResource, ProjectDetailResource
from .views import ProjectListView, ProjectDetailView, ProjectMapView

project_resource = ProjectResource()
projectdetail_resource = ProjectDetailResource()


urlpatterns = patterns('apps.projects.views',
    surl(r'^$', ProjectListView.as_view(), name='project_list'),
    surl(r'^<slug:s>/$', ProjectDetailView.as_view(), name='project_detail'),
    surl(r'^<slug:s>/map/$', ProjectMapView.as_view(), name='project_map'),
)

# API urls
urlpatterns += patterns('',
    url(r'^api/', include(project_resource.urls)),
    url(r'^api/', include(projectdetail_resource.urls)),
)


from django.conf.urls.defaults import patterns, url, include

from surlex.dj import surl

from .api import ProjectResource, ProjectDetailResource, ProjectSearchFormResource
from .views import ProjectListView, ProjectDetailView, ProjectMapView

project_resource = ProjectResource()
projectdetail_resource = ProjectDetailResource()
projectsearchform_resource = ProjectSearchFormResource()


urlpatterns = patterns('apps.projects.views',
    surl(r'^$', ProjectListView.as_view(), name='project_list'),
    surl(r'^<slug:s>/$', ProjectDetailView.as_view(), name='project_detail'),
    surl(r'^<slug:s>/map/$', ProjectMapView.as_view(), name='project_map'),
)

# API urls
urlpatterns += patterns('',
    url(r'^api/', include(project_resource.urls)),
    url(r'^api/', include(projectdetail_resource.urls)),
    url(r'^api/', include(projectsearchform_resource.urls)),
)


Enable project search form API.
Enable project search form API.

  from django.conf.urls.defaults import patterns, url, include
  
  from surlex.dj import surl
  
- from .api import ProjectResource, ProjectDetailResource
+ from .api import ProjectResource, ProjectDetailResource, ProjectSearchFormResource
  from .views import ProjectListView, ProjectDetailView, ProjectMapView
  
  project_resource = ProjectResource()
  projectdetail_resource = ProjectDetailResource()
+ projectsearchform_resource = ProjectSearchFormResource()
  
  
  urlpatterns = patterns('apps.projects.views',
      surl(r'^$', ProjectListView.as_view(), name='project_list'),
      surl(r'^<slug:s>/$', ProjectDetailView.as_view(), name='project_detail'),
      surl(r'^<slug:s>/map/$', ProjectMapView.as_view(), name='project_map'),
  )
  
  # API urls
  urlpatterns += patterns('',
      url(r'^api/', include(project_resource.urls)),
      url(r'^api/', include(projectdetail_resource.urls)),
+     url(r'^api/', include(projectsearchform_resource.urls)),
  )
  
  
Enable project search form API.
## Code Before:
from django.conf.urls.defaults import patterns, url, include

from surlex.dj import surl

from .api import ProjectResource, ProjectDetailResource
from .views import ProjectListView, ProjectDetailView, ProjectMapView

project_resource = ProjectResource()
projectdetail_resource = ProjectDetailResource()


urlpatterns = patterns('apps.projects.views',
    surl(r'^$', ProjectListView.as_view(), name='project_list'),
    surl(r'^<slug:s>/$', ProjectDetailView.as_view(), name='project_detail'),
    surl(r'^<slug:s>/map/$', ProjectMapView.as_view(), name='project_map'),
)

# API urls
urlpatterns += patterns('',
    url(r'^api/', include(project_resource.urls)),
    url(r'^api/', include(projectdetail_resource.urls)),
)


## Instruction:
Enable project search form API.
## Code After:
from django.conf.urls.defaults import patterns, url, include

from surlex.dj import surl

from .api import ProjectResource, ProjectDetailResource, ProjectSearchFormResource
from .views import ProjectListView, ProjectDetailView, ProjectMapView

project_resource = ProjectResource()
projectdetail_resource = ProjectDetailResource()
projectsearchform_resource = ProjectSearchFormResource()


urlpatterns = patterns('apps.projects.views',
    surl(r'^$', ProjectListView.as_view(), name='project_list'),
    surl(r'^<slug:s>/$', ProjectDetailView.as_view(), name='project_detail'),
    surl(r'^<slug:s>/map/$', ProjectMapView.as_view(), name='project_map'),
)

# API urls
urlpatterns += patterns('',
    url(r'^api/', include(project_resource.urls)),
    url(r'^api/', include(projectdetail_resource.urls)),
    url(r'^api/', include(projectsearchform_resource.urls)),
)

