from django.conf.urls.defaults import patterns, url from djangorestframework.views import ListModelView, InstanceModelView from freevana.resources import MovieResource, MovieSourceResource urlpatterns = patterns('', url(r'^movies/$', ListModelView.as_view(resource=MovieResource), name='movie-list'), url(r'^movies/(?P<id>[^/]+)/$', InstanceModelView.as_view(resource=MovieResource), name='movie-detail'), url(r'^movies/(?P<movie>[^/]+)/sources/$', ListModelView.as_view(resource=MovieSourceResource), name='movie-source-list'), url(r'^movies/(?P<movie>[^/]+)/sources/(?P<id>[^/]+)/$', InstanceModelView.as_view(resource=MovieSourceResource)), )
from django.conf.urls.defaults import * from django.views.generic import ListView from django.views.generic.simple import direct_to_template # app imports from alibrary.models import Artist, Release, Media, Label from alibrary.views import * # rest from djangorestframework.views import ListOrCreateModelView, InstanceModelView, ListModelView, InstanceModelViewRO from alibrary.resources import * urlpatterns = patterns('', # REST-API urls url(r'^/$', direct_to_template, {'template': 'alibrary/api/index.html'}), url(r'^releases/$', ListModelView.as_view(resource=ReleaseResource), name='release-resource-root'), url(r'^releases/(?P<uuid>[-\w]+)/$', InstanceModelViewRO.as_view(resource=ReleaseResource), name='release-resource-detail'), url(r'^tracks/$', ListModelView.as_view(resource=MediaResource), name='media-resource-root'), url(r'^tracks/(?P<uuid>[-\w]+)/$', InstanceModelViewRO.as_view(resource=MediaResource), name='media-resource-detail'), url(r'^artists/$', ListModelView.as_view(resource=ArtistResource), name='artist-resource-root'), url(r'^artists/(?P<uuid>[-\w]+)/$', InstanceModelViewRO.as_view(resource=ArtistResource), name='artist-resource-detail'), )
return reverse("photo-flag", kwargs={"pk": instance.pk}) def image_url(self, instance): return reverse("serve-photo", kwargs={"pk": instance.pk}) def gallery_url(self, instance): return reverse("gallery-instance", kwargs={"pk": instance.gallery_id}) def url(self, instance): return reverse("photo-instance", kwargs={"pk": instance.pk}) urlpatterns = patterns( "", # url(r'^$', GalleryOverviewView.as_view(), name ='gallery-overview'), url(r"^$", ListModelView.as_view(resource=GalleryResource), name="gallery-index"), # url(r'^uploads$', PhotoListView.as_view(resource=PhotoResource), name='photos-current-user'), url(r"^(?P<gallery>\w+)/photos$", never_cache(PhotoListView.as_view(resource=PhotoResource)), name="photo-list"), # url(r'^(?P<gallery>\w+)/photos(/)?\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'), # url(r'^(?P<gallery>\w+)/photos/(?P<user>\w+)\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'), url( r"^(?P<gallery>\w+)/photos/(?P<user>\w+)$", never_cache(PhotoListView.as_view(resource=PhotoResource)), name="photo-list", ), url(r"^(?P<pk>\w+)$", GalleryListView.as_view(resource=GalleryResource), name="gallery-instance"), # upload urls url(r"^(?P<pk>\w+)/upload$", never_cache(PhotoUploadView.as_view()), name="photo-upload"), url( r"^(?P<pk>\w+)/(?P<user_id>\w+)/postupload$", never_cache(PostPhotoUploadView.as_view(resource=PhotoResource)),
return kwargs urlpatterns = patterns('', url( r'^city/$', CityListModelView.as_view(resource=CityResource), name='cities_light_api_city_list', ), url( r'^city/(?P<pk>[^/]+)/$', DetailView.as_view(resource=CityResource), name='cities_light_api_city_detail', ), url( r'^region/$', ListModelView.as_view(resource=RegionResource), name='cities_light_api_region_list', ), url( r'^region/(?P<pk>[^/]+)/$', DetailView.as_view(resource=RegionResource), name='cities_light_api_region_detail', ), url( r'^country/$', ListModelView.as_view(resource=CountryResource), name='cities_light_api_country_list', ), url( r'^country/(?P<pk>[^/]+)/$', DetailView.as_view(resource=CountryResource),
from django.conf.urls import patterns, include, url from djangorestframework.views import ListModelView, InstanceModelView from .resources import CommentResource, ContributorResource, PointResource, RegionResource, VoteResource, ProjectResource from .views import ActivityStreamView, ReadInstanceModelView urlpatterns = patterns( 'shareabouts', url(r'^(?:(?P<commentable__project__slug>[^/]*)/)?comments/$', ListModelView.as_view(resource=CommentResource)), url(r'^(?:(?P<commentable__project__slug>[^/]*)/)?comments/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=CommentResource)), # This one's tricky; a contributor doesn't have a project. url(r'^contributors/$', ListModelView.as_view(resource=ContributorResource)), url(r'^contributors/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=ContributorResource)), url(r'^projects/$', ListModelView.as_view(resource=ProjectResource)), url(r'^projects/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=ProjectResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?points/$', ListModelView.as_view(resource=PointResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?points/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=PointResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?regions/$', ListModelView.as_view(resource=RegionResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?regions/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=RegionResource)), url(r'^(?:(?P<supportable__project__slug>[^/]*)/)?votes/$', ListModelView.as_view(resource=VoteResource)), url(r'^(?:(?P<supportable__project__slug>[^/]*)/)?votes/(?P<pk>.*)',
name='publisher-instance'), url(r'^games/$', ListOrCreateModelView.as_view(resource=GameResource, permissions=(IsUserOrIsAnonReadOnly, )), name='game-list'), url(r'^games/(?P<pk>[^/]+)/$', InstanceModelView.as_view( resource=GameResource, permissions=(IsUserOrIsAnonReadOnly, )), name='game-instance'), url(r'^conventions/$', ListOrCreateModelView.as_view( resource=ConventionResource, permissions=(IsUserOrIsAnonReadOnly, )), name='convention-list'), url(r'^conventions/(?P<pk>[^/]+)$', InstanceModelView.as_view( resource=ConventionResource, permissions=(IsUserOrIsAnonReadOnly, )), name='convention-instance'), url(r'^events/$', EventRoot.as_view(), name='event-list'), url(r'^events/(?P<pk>[^/]+)/$', EventModelView.as_view(), name='event-instance'), url(r'^events/(?P<pk>[^/]+)/join/$', EventJoinView.as_view(), name='event-instance-join'), url(r'^events/(?P<pk>[^/]+)/leave/$', EventLeaveView.as_view(), name='event-instance-leave'), url(r'^demands/$', DemandRoot.as_view(), name='demand-list'), url(r'^demands/(?P<pk>[^/]+)$', DemandModelView.as_view(), name='demand-instance'), url(r'users/$', ListModelView.as_view(resource=UserResource), name='user-list'), url(r'users/(?P<username>[^/]+)/$', UserModelView.as_view()) )
from django.conf.urls import patterns, include, url from djangorestframework.views import ListModelView, InstanceModelView from .resources import CommentResource, ContributorResource, PointResource, RegionResource, VoteResource, ProjectResource from .views import ActivityStreamView, ReadInstanceModelView urlpatterns = patterns('shareabouts', url(r'^(?:(?P<commentable__project__slug>[^/]*)/)?comments/$', ListModelView.as_view(resource=CommentResource)), url(r'^(?:(?P<commentable__project__slug>[^/]*)/)?comments/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=CommentResource)), # This one's tricky; a contributor doesn't have a project. url(r'^contributors/$', ListModelView.as_view(resource=ContributorResource)), url(r'^contributors/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=ContributorResource)), url(r'^projects/$', ListModelView.as_view(resource=ProjectResource)), url(r'^projects/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=ProjectResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?points/$', ListModelView.as_view(resource=PointResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?points/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=PointResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?regions/$', ListModelView.as_view(resource=RegionResource)), url(r'^(?:(?P<project__slug>[^/]*)/)?regions/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=RegionResource)), url(r'^(?:(?P<supportable__project__slug>[^/]*)/)?votes/$', ListModelView.as_view(resource=VoteResource)), url(r'^(?:(?P<supportable__project__slug>[^/]*)/)?votes/(?P<pk>.*)', ReadInstanceModelView.as_view(resource=VoteResource)), url(r'^(?:(?P<project_slug>[^/]*)/)?activity$', ActivityStreamView.as_view()), )
from api.resources import ZarazeniOrganResource from api.resources import ZarazeniFunkceResource from api.resources import PoslanecResource from api.resources import PkgpsResource from api.resources import HlasovaniResource from api.resources import HlasovaniPoslanecResource from api.resources import OmluvaResource from api.resources import ZpochybneniResource from api.resources import ZpochybneniPoslanecResource from api.resources import HlasovaniVazbyResource from api.views import InstanceModelReadOnlyView from api.views import Overview urlpatterns = patterns('', url(r'^$', Overview.as_view()), url(r'^osoba/$', ListModelView.as_view(resource=OsobaResource), name='osoby'), url(r'^osoba/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=OsobaResource), name='osoba'), url(r'^typ_organu/$', ListModelView.as_view(resource=TypOrganuResource), name='typy_organu'), url(r'^typ_organu/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=TypOrganuResource), name='typ_organu'), url(r'^typ_funkce/$', ListModelView.as_view(resource=TypFunkceResource), name='typy_funkci'), url(r'^typ_funkce/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=TypFunkceResource), name='typ_funkce'), url(r'^organ/$', ListModelView.as_view(resource=OrganResource), name='organy'), url(r'^organ/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=OrganResource), name='organ'), url(r'^funkce/$', ListModelView.as_view(resource=FunkceResource), name='funkce-list'), url(r'^funkce/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=FunkceResource), name='funkce'), url(r'^zarazeni_organ/$', ListModelView.as_view(resource=ZarazeniOrganResource), name='zarazeni_organu'), url(r'^zarazeni_organ/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=ZarazeniOrganResource), name='zarazeni_organ'), url(r'^zarazeni_funkce/$', ListModelView.as_view(resource=ZarazeniFunkceResource), name='zarazeni_funkci'), url(r'^zarazeni_funkce/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=ZarazeniFunkceResource), name='zarazeni_funkce'), url(r'^poslanec/$', ListModelView.as_view(resource=PoslanecResource), name='poslanci'), url(r'^poslanec/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=PoslanecResource), name='poslanec'),
from django.conf.urls import patterns, include, url from django.contrib import admin from wic.views import * from djangorestframework.views import ListModelView, InstanceModelView from wic.resources import * admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^news/(?P<slug>[^\.]+)', 'wic.views.view_article' , name='view_article'), url(r'^live/$', 'wic.views.gigs_index' ), url(r'^live/previous/$', 'wic.views.gigs_old' ), url(r'^gigs/(?P<slug>[^\.]+)', 'wic.views.view_gig' , name='view_gig'), url(r'^media/photos/$', 'wic.views.media_photos' ), url(r'^media/discography/$', 'wic.views.media_discography' ), url(r'^media/videos/$', 'wic.views.media_videos' ), url(r'^band/$', 'wic.views.band_index' ), url(r'^contact/$', 'wic.views.contact' ), url(r'^thanks/$', 'django.views.generic.simple.direct_to_template', {'template': 'contact-thanks.html'}), url(r'^$', 'wic.views.main_index' ), url(r'^api/devices/$', AuthenticatedListOrCreateModelView.as_view(resource=DeviceTokensResource)), url(r'^api/live/$', ListModelView.as_view(resource=GigsResource)), url(r'^api/photos/$', ListModelView.as_view(resource=PhotosResource)), url(r'^api/discography/$', ListModelView.as_view(resource=DiscographyResource)), url(r'^api/members/$', ListModelView.as_view(resource=MembersResource)), url(r'^api/news/$', ListModelView.as_view(resource=NewsResource)), url(r'^api/news/(?P<slug>[^\.]+)/$', InstanceModelView.as_view(resource=NewsResource)), url(r'^api/albums/$', ListModelView.as_view(resource=AlbumsResource)), )
from django.conf.urls.defaults import * from django.views.generic import ListView from django.views.generic.simple import direct_to_template # app imports from importer.models import Artist, Release, Media, Label # rest from djangorestframework.views import ListOrCreateModelView, InstanceModelView, ListModelView, InstanceModelViewRO from importer.resources import * urlpatterns = patterns( '', url(r'^importer/$', ListModelView.as_view(resource=ImportResource), name='release-resource-root'), url(r'^importer/(?P<pk>[-\w]+)/$', InstanceModelViewRO.as_view(resource=ImportResource), name='release-resource-detail'), )
return reverse('gallery-instance', kwargs={ 'pk': instance.gallery_id, }) def url(self, instance): return reverse('photo-instance', kwargs={ 'pk': instance.pk, }) urlpatterns = patterns( '', #url(r'^$', GalleryOverviewView.as_view(), name ='gallery-overview'), url(r'^$', ListModelView.as_view(resource=GalleryResource), name='gallery-index'), #url(r'^uploads$', PhotoListView.as_view(resource=PhotoResource), name='photos-current-user'), url(r'^(?P<gallery>\w+)/photos$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'), #url(r'^(?P<gallery>\w+)/photos(/)?\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'), #url(r'^(?P<gallery>\w+)/photos/(?P<user>\w+)\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'), url(r'^(?P<gallery>\w+)/photos/(?P<user>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'), url(r'^(?P<pk>\w+)$', GalleryListView.as_view(resource=GalleryResource), name='gallery-instance'), #upload urls
from django.conf.urls.defaults import * from django.views.generic import ListView from django.views.generic.simple import direct_to_template # app imports from importer.models import Artist, Release, Media, Label # rest from djangorestframework.views import ListOrCreateModelView, InstanceModelView, ListModelView, InstanceModelViewRO from importer.resources import * urlpatterns = patterns('', url(r'^importer/$', ListModelView.as_view(resource=ImportResource), name='release-resource-root'), url(r'^importer/(?P<pk>[-\w]+)/$', InstanceModelViewRO.as_view(resource=ImportResource), name='release-resource-detail'), )
from djangorestframework.views import ListModelView from utils.api import ReadModelView from comics.models import Chapter, Comics class ChapterResource(ModelResource): model = Chapter fields = ('id', 'title', 'slug', 'cover_url') def cover_url(self, instance): return instance.cover.url class ComicsResource(ModelResource): model = Comics fields = ('id', 'chapter', 'title', 'image_url', 'alt', 'position') def image_url(self, instance): return instance.image.url urlpatterns = patterns('', url(r'^chapter/$', ListModelView.as_view(resource=ChapterResource), name='api.comics.chapters'), (r'^chapter/(?P<pk>\d+)/$', ReadModelView.as_view(resource=ChapterResource)), url(r'^comics/$', ListModelView.as_view(resource=ComicsResource), name='api.comics'), (r'^comics/(?P<pk>\d+)/$', ReadModelView.as_view(resource=ComicsResource)), )
#from django.conf.urls.defaults import * from django.conf.urls.defaults import patterns, url from djangorestframework.views import ListOrCreateModelView, InstanceModelView, ModelView, ListModelView from contacts.resources import TestResource, AddressResource from views import * from django.conf import settings import django.contrib.auth.views urlpatterns = patterns('djangoextension.contacts.views', url(r'address/create/$', "root_view", name='root'), url(r'address/$', "list_view", name='list'), #url(r'address/query/(?P<query>[^/]+/$)', "query_view", name='query'), #url(r'address/.*$)', "query_view", name='query'), ) urlpatterns += patterns('', url(r'test/$', ListOrCreateModelView.as_view(resource=TestResource), name='test-root'), url(r'test/(?P<id>[^/]+)/$', InstanceModelView.as_view(resource=TestResource), name='test-post'), url(r'address/api/$', ListModelView.as_view(resource=AddressResource), name='address-root'), url(r'address/api/(?P<id>[^/]+)/$', InstanceModelView.as_view(resource=AddressResource), name='address-post'), )
from api.resources import PoslanecResource from api.resources import PkgpsResource from api.resources import HlasovaniResource from api.resources import HlasovaniPoslanecResource from api.resources import OmluvaResource from api.resources import ZpochybneniResource from api.resources import ZpochybneniPoslanecResource from api.resources import HlasovaniVazbyResource from api.views import InstanceModelReadOnlyView from api.views import Overview urlpatterns = patterns( '', url(r'^$', Overview.as_view()), url(r'^osoba/$', ListModelView.as_view(resource=OsobaResource), name='osoby'), url(r'^osoba/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=OsobaResource), name='osoba'), url(r'^typ_organu/$', ListModelView.as_view(resource=TypOrganuResource), name='typy_organu'), url(r'^typ_organu/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=TypOrganuResource), name='typ_organu'), url(r'^typ_funkce/$', ListModelView.as_view(resource=TypFunkceResource), name='typy_funkci'), url(r'^typ_funkce/(?P<id>[^/]+)/$', InstanceModelReadOnlyView.as_view(resource=TypFunkceResource),
# app imports from alibrary.models import Artist, Release, Media, Label from alibrary.views import * # rest from djangorestframework.views import ListOrCreateModelView, InstanceModelView, ListModelView, InstanceModelViewRO from alibrary.resources import * urlpatterns = patterns( '', # REST-API urls url(r'^/$', direct_to_template, {'template': 'alibrary/api/index.html'}), url(r'^releases/$', ListModelView.as_view(resource=ReleaseResource), name='release-resource-root'), url(r'^releases/(?P<uuid>[-\w]+)/$', InstanceModelViewRO.as_view(resource=ReleaseResource), name='release-resource-detail'), url(r'^tracks/$', ListModelView.as_view(resource=MediaResource), name='media-resource-root'), url(r'^tracks/(?P<uuid>[-\w]+)/$', InstanceModelViewRO.as_view(resource=MediaResource), name='media-resource-detail'), url(r'^artists/$', ListModelView.as_view(resource=ArtistResource), name='artist-resource-root'), url(r'^artists/(?P<uuid>[-\w]+)/$', InstanceModelViewRO.as_view(resource=ArtistResource),
class ArticleInstanceResource(ModelResource): model = Article fields = ( 'slug', 'id', 'name', 'publish_on', 'content', ) urlpatterns = patterns( '', url(r'^$', News.as_view(), name='news-overview'), url(r'^index$', ListModelView.as_view(resource=EntryResource, ), name='news-index'), url(r'^articles$', ListModelView.as_view(resource=ArticleResource, ), name='article-index'), url(r'^articles/(?P<pk>\w+)$', ArticleView.as_view(resource=ArticleInstanceResource), name='article-instance'), #url(r'^(?P<pk>[0-9]+)/$', InstanceModelView.as_view(resource=EntryResource)), #url(r'^image/(?P<pk>\w+)$', download_handler, name='news-image'), url(r'^image/(?P<pk>\w+)$', baseviews.ImageServeView.as_view(container=NewsImage), name='news-image'), )