# wwwhisper - web access control. # Copyright (C) 2012-2015 Jan Wrobel <*****@*****.**> """Urls exposed by the wwwhisper_admin application.""" from django.conf.urls import patterns, url from views import CollectionView, ItemView, SkinView from views import OpenAccessView, AllowedUsersView urlpatterns = patterns( 'wwwhisper_admin.views', url(r'^users/$', CollectionView.as_view(collection_name='users')), url(r'^users/(?P<uuid>[0-9a-z-]+)/$', ItemView.as_view(collection_name='users'), name='wwwhisper_user'), url(r'^locations/$', CollectionView.as_view(collection_name='locations')), url(r'^locations/(?P<uuid>[0-9a-z-]+)/$', ItemView.as_view(collection_name='locations'), name='wwwhisper_location'), url(r'^locations/(?P<location_uuid>[0-9a-z-]+)/allowed-users/' + '(?P<user_uuid>[0-9a-z-]+)/$', AllowedUsersView.as_view(), name='wwwhisper_allowed_user'), url(r'^locations/(?P<location_uuid>[0-9a-z-]+)/open-access/$', OpenAccessView.as_view()), url(r'^aliases/$', CollectionView.as_view(collection_name='aliases')), url(r'^aliases/(?P<uuid>[0-9a-z-]+)/$', ItemView.as_view(collection_name='aliases'), name='wwwhisper_alias'), url(r'^skin/$', SkinView.as_view()), )
from django.conf.urls import patterns, url from views import CategoryView, ItemView, IndexView, CheckoutView urlpatterns = patterns('', url(r'^about/', 'store.views.about', name='about'), url(r'^contact/', 'store.views.contact', name='contact'), url(r'^thanks/', 'store.views.thanks', name='thanks'), url(r'^purchase/success/', 'store.views.purchase_success', name='store_purchase_success'), url(r'^collection/(?P<slug>[-a-zA-Z0-9_]{1,50})/$', CategoryView.as_view(), name='store_category'), url(r'^item/(?P<pk>\d+)/$', ItemView.as_view(), name='store_item'), url(r'^item/(?P<pk>\d+)/purchase$', CheckoutView.as_view(), name='store_item_purchase'), url(r'^$', IndexView.as_view(), name='index'), )
# wwwhisper - web access control. # Copyright (C) 2012-2015 Jan Wrobel <*****@*****.**> """Urls exposed by the wwwhisper_admin application.""" from django.conf.urls import patterns, url from views import CollectionView, ItemView, SkinView from views import OpenAccessView, AllowedUsersView urlpatterns = patterns( 'wwwhisper_admin.views', url(r'^users/$', CollectionView.as_view(collection_name='users')), url(r'^users/(?P<uuid>[0-9a-z-]+)/$', ItemView.as_view(collection_name='users'), name='wwwhisper_user'), url(r'^locations/$', CollectionView.as_view(collection_name='locations')), url(r'^locations/(?P<uuid>[0-9a-z-]+)/$', ItemView.as_view(collection_name='locations'), name='wwwhisper_location'), url(r'^locations/(?P<location_uuid>[0-9a-z-]+)/allowed-users/' + '(?P<user_uuid>[0-9a-z-]+)/$', AllowedUsersView.as_view(), name='wwwhisper_allowed_user'), url(r'^locations/(?P<location_uuid>[0-9a-z-]+)/open-access/$', OpenAccessView.as_view()), url(r'^aliases/$', CollectionView.as_view(collection_name='aliases')), url(r'^aliases/(?P<uuid>[0-9a-z-]+)/$', ItemView.as_view(collection_name='aliases'),
from django.conf.urls.defaults import patterns, url from django.views.generic.base import TemplateView from views import SearchView, ItemView urlpatterns = patterns('', url(r'^$', SearchView.as_view(), name='index'), url(r'^search/$', SearchView.as_view(), name='search'), url(r'^(?P<item_path>.*)/$', ItemView.as_view(), name='item'), )
def test_create_item(self): production_view = ProductionView() production = production_view.create_production() item = ItemView._create_item({'production_id': production.id}) ItemView._read_item(item.id)
from django.contrib.auth import views as auth_views from customer import views from views import HomeView,DeleteView,ContactView,MessageView,RegisterationView,AddToCartView,BuyView,ChangePasswordView,AdminHome,MyOrderView,MyProductView1,MyWalletVew,ItemView,MyProductView2,MyProductView3,MyProductView4 urlpatterns = [ url(r'^home/$',HomeView.as_view() , name="main"), url(r'^adminhome/$',AdminHome.as_view() , name="admin_home"), url(r'^login/$',views.login , name="customer_login" ), url(r'^logout/$',auth_views.logout ,{"template_name":"index.html"}, name="customer_logout"), url(r'^registeration/$', RegisterationView.as_view() , name="customer_regiseraion"), url(r'^change/password',ChangePasswordView.as_view() , name="password_change"), url(r'^myorder/$',MyOrderView.as_view(), name="my_order"), url(r'^item/([a-zA-Z\s]+)/$',ItemView.as_view(), name="my_items"), url(r'^delete/([a-zA-Z\s]+)/$',DeleteView.as_view(), name="del_items"), url(r'^views1',MyProductView1.as_view(), name="my_product1"), url(r'^views2',MyProductView2.as_view(), name="my_product2"), url(r'^views3',MyProductView3.as_view(), name="my_product3"), url(r'^views4',MyProductView4.as_view(), name="my_product4"), url(r'^wallet',MyWalletVew.as_view(), name="mt_wallet"), url(r'^buy',BuyView.as_view(), name="buy_view"), url(r'^cart/([a-zA-Z\s]+)/$',AddToCartView.as_view(), name="add_to_cart"), url(r'^message',MessageView.as_view(), name="message_view"), url(r'^contacts/',ContactView.as_view(), name="contact_view"),
app.url_map.converters['regex'] = RegexConverter app.add_url_rule("/", view_func=HomeView.as_view('home_view')) app.add_url_rule("/json", view_func=HomeView.as_view('home_json')) app.add_url_rule("/xml", view_func=HomeView.as_view('home_xml')) # /category app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()), view_func=CategoryView.as_view('category_view')) app.add_url_rule('/<regex("{}"):category>/json'.format(utils.get_cat_regex()), view_func=CategoryView.as_view('category_json')) app.add_url_rule('/<regex("{}"):category>/xml'.format(utils.get_cat_regex()), view_func=CategoryView.as_view('category_xml')) # /category/item_id app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>', view_func=ItemView.as_view('item_view')) app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/json', view_func=ItemView.as_view('item_json')) app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/xml', view_func=ItemView.as_view('item_xml')) # /category/item_id/delete app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/delete', view_func=ItemDeleteView.as_view('itemdelete_view')) # /category/item_id/update app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/update', view_func=ItemUpdateView.as_view('itemupdate_view')) app.add_url_rule("/me", view_func=MyAccountView.as_view('myaccount_view'))
app.add_url_rule("/json", view_func=HomeView.as_view('home_json')) app.add_url_rule("/xml", view_func=HomeView.as_view('home_xml')) # /category app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()), view_func=CategoryView.as_view('category_view')) app.add_url_rule( '/<regex("{}"):category>/json'.format( utils.get_cat_regex()), view_func=CategoryView.as_view('category_json')) app.add_url_rule( '/<regex("{}"):category>/xml'.format( utils.get_cat_regex()), view_func=CategoryView.as_view('category_xml')) # /category/item_id app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>', view_func=ItemView.as_view('item_view')) app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/json', view_func=ItemView.as_view('item_json')) app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/xml', view_func=ItemView.as_view('item_xml')) # /category/item_id/delete app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/delete', view_func=ItemDeleteView.as_view('itemdelete_view')) # /category/item_id/update app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) + '/<int:item_id>/update', view_func=ItemUpdateView.as_view('itemupdate_view')) app.add_url_rule("/me", view_func=MyAccountView.as_view('myaccount_view')) app.add_url_rule("/items/add", view_func=ItemAddView.as_view('additem_view')) app.add_url_rule("/user/<int:uid>", view_func=UserView.as_view('user_view'))
import os.path as op from flask_admin import Admin from flask_admin.base import AdminIndexView from app import app, db from models import Character, CharacterItem, CharacterMove, Item, Location, build_sample_db from views import CharacterView, CharacterItemView, CharacterMoveView, ItemView, LocationView admin = Admin(app, name='game control', template_mode='bootstrap3', index_view=AdminIndexView(name='Home', url='/') ) admin.add_views( CharacterView(Character, db.session), CharacterItemView(CharacterItem, db.session), CharacterMoveView(CharacterMove, db.session), ItemView(Item, db.session), LocationView(Location, db.session) ) if __name__ == '__main__': app_dir = op.realpath(op.dirname(__file__)) database_path = op.join(app_dir, app.config['DATABASE_FILE']) if not op.exists(database_path): build_sample_db() app.run()
# along with this program. If not, see <http://www.gnu.org/licenses/>. """Urls exposed by the wwwhisper_admin application.""" from django.conf.urls.defaults import patterns, url from views import CollectionView, ItemView from views import OpenAccessView, AllowedUsersView from wwwhisper_auth import models users_collection = models.UsersCollection() locations_collection = models.LocationsCollection() urlpatterns = patterns( "wwwhisper_admin.views", url(r"^users/$", CollectionView.as_view(collection=users_collection)), url(r"^users/(?P<uuid>[0-9a-z-]+)/$", ItemView.as_view(collection=users_collection)), url(r"^locations/$", CollectionView.as_view(collection=locations_collection)), url( r"^locations/(?P<uuid>[0-9a-z-]+)/$", ItemView.as_view(collection=locations_collection), name="wwwhisper_location", ), url( r"^locations/(?P<location_uuid>[0-9a-z-]+)/allowed-users/" + "(?P<user_uuid>[0-9a-z-]+)/$", AllowedUsersView.as_view(locations_collection=locations_collection), name="wwwhisper_allowed_user", ), url( r"^locations/(?P<location_uuid>[0-9a-z-]+)/open-access/$", OpenAccessView.as_view(locations_collection=locations_collection), ),