示例#1
0
class RegisterController(BaseController):
    def __init__(self, router, payload):
        super().__init__(router, payload)

        self.__view = RegisterView(self)

        route = self.get_route()

        if route == STUDENT_REGISTER_ROUTE:
            self.__student_id = self.get_payload()['id']
        elif route == REGISTRAR_REGISTER_STUDENT_ROUTE:
            self.__student_id = self.get_payload()['student_id']

        self.__student_name = get_username_and_full_name(
            Student, self.__student_id)['full_name']

        self.__view.render(
            {'view_title': f'Register {self.__student_name} for Sections'})

    '''
		Received the section id inputted from user
		along with the student's id.

		@param section_id {str} Primary key of section
	'''

    def on_id_selection(self, section_id):

        try:
            reg = Registration(section_id=section_id,
                               student_id=self.__student_id)

            if reg.save():

                section_name = get_section_name(section_id)

                if section_name:
                    self.__view.print_message(
                        f'Successfully registered {self.__student_name} for {section_name}.'
                    )
                else:
                    self.__view.print_message(
                        'Successfully registered for section.')
            else:
                self.__view.print_message(f'Failed to register for section.')
        except IntegrityError:
            self.__view.print_message('Unable to register for section.')
示例#2
0
    def __init__(self, router, payload):
        super().__init__(router, payload)

        self.__view = RegisterView(self)

        route = self.get_route()

        if route == STUDENT_REGISTER_ROUTE:
            self.__student_id = self.get_payload()['id']
        elif route == REGISTRAR_REGISTER_STUDENT_ROUTE:
            self.__student_id = self.get_payload()['student_id']

        self.__student_name = get_username_and_full_name(
            Student, self.__student_id)['full_name']

        self.__view.render(
            {'view_title': f'Register {self.__student_name} for Sections'})
示例#3
0
'''
Created on 2012-7-25

@author: TheBeet
'''
from django.conf.urls.defaults import patterns, url

from views import ajax_login, ajax_logout, UserDetailView, UserRankView, UserStatisticView, RegisterView

urlpatterns = patterns(
    '',
    url(r'^login/$', ajax_login, name="login"),
    url(r'^logout/$', ajax_logout, name="logout"),
    url(r'^profile/(?P<slug>\w+)/$', UserDetailView.as_view(), name="detail"),
    url(r'^statistic/(?P<slug>\w+)/$',
        UserStatisticView.as_view(),
        name="statistic"),
    url(r'^rank/$', UserRankView.as_view(), name="rank"),
    url(r'^register/$', RegisterView.as_view(), name="register"),
)
示例#4
0
from decorators import not_logged_in_required

urlpatterns = patterns(
    '',
    url(r'^/login/$',
        not_logged_in_required(login),
        {'authentication_form': EmailAuthenticationForm},
        name='login'),
    url(r'^/logout/$',
        'django.contrib.auth.views.logout', {'next_page': '/'},
        name='logout'),
    url(r'^/password/reset/$',
        'django.contrib.auth.views.password_reset', {
            'post_reset_redirect': '/user/password/reset/done/',
            'template_name': 'registration/password_reset_form.html',
            'email_template_name': 'registration/password_reset_email.html'
        },
        name='password_reset'),
    url(r'^/password/reset/done/$',
        'django.contrib.auth.views.password_reset_done',
        {'template_name': 'registration/password_reset_done.html'}),
    url(r'^/password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
        'django.contrib.auth.views.password_reset_confirm',
        {'post_reset_redirect': '/user/password/done/'}),
    url(r'^/password/done/$',
        'django.contrib.auth.views.password_reset_complete',
        {'template_name': 'registration/password_reset_complete.html'}),
    url(r'^/register/$',
        not_logged_in_required(RegisterView.as_view()),
        name='register'),
)
示例#5
0
文件: urls.py 项目: yuansmin/myblog
from django.conf.urls import patterns, url
from views import index, ArticleView, ArticlePublish, not_found, Contact, about, Test, RegisterView, cus_login, cus_logout, page_not_found, search

urlpatterns = patterns('',
                       url(r'^$', index, name='index'),
                       url(r'^article/$', ArticleView.as_view(), name='article_detail'),
                       url(r'^articlepublish/$', ArticlePublish.as_view(), name='article_publish'),
                       url(r'^404/$', not_found),
                       url(r'^contact/$', Contact.as_view(), name='contact'),
                       url(r'^about/$', about, name='about'),
                       url(r'^test/$', Test.as_view()),
                       url(r'^register/$', RegisterView.as_view(), name='register'),
                       url(r'^login/$', cus_login, name='login'),
                       url(r'^logout/$', cus_logout, name='logout'),
                       url(r'^search/$', search, name='search'),
                       url(r'^.*/$', page_not_found, name='not_found'),
        )


示例#6
0
from django.conf.urls import patterns, url
from views import SignInView, RegisterView, SendTweets

urlpatterns = patterns('',
    url(r'^signin/', SignInView.as_view()),
    url(r'^register/', RegisterView.as_view()),
    url(r'^tweet/', SendTweets.as_view()),
)
示例#7
0
文件: urls.py 项目: gdsp/gdsp
from django.conf.urls import patterns, include, url
from django.contrib import auth

from views import RegisterView

urlpatterns = patterns('',
        url(r'^login/$',
            'accounts.views.home_login',
            {'template': 'accounts/login.html'},
            name='login'),                       
        url(r'^login_return/$',
            'django.contrib.auth.views.login',
            kwargs={'template_name': 'accounts/login.html'},
            name='login_return',),
        url(r'^logout/$',
            'django.contrib.auth.views.logout',
            kwargs={'next_page': '/'},
            name='logout',),
        url(r'^register/$',
            RegisterView.as_view(),
            name='register'),
)
示例#8
0
from django.conf.urls import url, include
from rest_framework.authtoken import views
from views import RegisterView, obtain_auth_token

urlpatterns = [
    url(r'^auth/register/?$', RegisterView.as_view(), name='register'),
    url(r'^auth/login', obtain_auth_token, name='login')
]
示例#9
0
import os
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask_peewee.db import Database

app = Flask(__name__)
app.config.from_object(os.environ.get('BADBATCH_SETTINGS'))
Bootstrap(app)
db = Database(app)

# Register views
from views import RegisterView, IndexPageView, AlertsView, ContactView, CallView
IndexPageView.register(app, route_base="/")
RegisterView.register(app, route_base="/register")
AlertsView.register(app, route_base="/alerts")
ContactView.register(app, route_base="/contact")
CallView.register(app, route_base="/voice")




示例#10
0
    url(r'^profil/karmatiser/$', 'zds.member.views.modify_karma'),
    url(r'^profil/modifier/(?P<user_pk>\d+)/$',
        'zds.member.views.modify_profile'),
    url(r'^parametres/mini_profil/(?P<user_name>.+)/$',
        'zds.member.views.settings_mini_profile'),
    url(r'^profil/multi/(?P<ip_address>.+)/$',
        'zds.member.views.member_from_ip'),

    #tutorials and articles
    url(r'^tutoriels/$', 'zds.member.views.tutorials'),
    url(r'^articles/$', 'zds.member.views.articles'),

    #user rights
    url(r'^profil/promouvoir/(?P<user_pk>\d+)/$',
        'zds.member.views.settings_promote'),

    #membership
    url(r'^connexion/$', 'zds.member.views.login_view'),
    url(r'^deconnexion/$', 'zds.member.views.logout_view'),
    url(r'^inscription/$', RegisterView.as_view(), name='register-member'),
    url(r'^reinitialisation/$', 'zds.member.views.forgot_password'),
    url(r'^validation/$',
        SendValidationEmailView.as_view(),
        name='send-validation-email'),
    url(r'^new_password/$', 'zds.member.views.new_password'),
    url(r'^activation/$', 'zds.member.views.active_account'),
    url(r'^envoi_jeton/$', 'zds.member.views.generate_token_account'),
    url(r'^desinscrire/valider/$', 'zds.member.views.unregister'),
    url(r'^desinscrire/avertissement/$',
        'zds.member.views.warning_unregister'))
示例#11
0
文件: urls.py 项目: Lulzcritic/Time
from views import CharacterCreateView
from views import DashboardView
from views import CreateSyndicatView
from views import SelectSyndicatView
from views import SyndicatDashboardView
from views import SelectRoleView
from views import WorkPageView
from views import AddTimeView
from views import MarketView
from views import SellView
from views import DieView
from views import InventoryView

urlpatterns = [
    url(r'^$', Home.as_view(), name='index'),
    url(r'^register/', RegisterView.as_view(), name='perso'),
    url(r'^connexion/', ConnexionView.as_view(), name='log-in'),
    url(r'^deconnexion/', DeconnexionView.as_view(), name='deconnexion'),
    url(r'^create_character/', CharacterCreateView.as_view(), name='create_character'),
    url(r'^dashboard/', DashboardView.as_view(), name='dashboard'),
    url(r'^create_syndicat/', CreateSyndicatView.as_view(), name='create_syndicat'),
    url(r'^select_syndicat/', SelectSyndicatView.as_view(), name='select_syndicat'),
    url(r'^dashboard_syndicat/', SyndicatDashboardView.as_view(), name='dashboard_syndicat'),
    url(r'^select_role/', SelectRoleView.as_view(), name='select_role'),
    url(r'^workpage/', WorkPageView.as_view(), name='workpage'),
    url(r'^add_time/', AddTimeView.as_view(), name='add_time'),
    url(r'^market/', MarketView.as_view(), name='market'),
    url(r'^die/', DieView.as_view(), name='die'),
    url(r'^market_sell/', SellView.as_view(), name='market_sell'),
    url(r'^inventory/', InventoryView.as_view(), name='inventory')
]
示例#12
0
from django.conf.urls import url

from views import RegisterView
from django.contrib.auth import views as auth_views

urlpatterns = [
    url(r'^register', RegisterView.as_view(), name='instagram.register'),
    url(r'^login$',
        auth_views.login, {'template_name': 'login.html'},
        name='instagram.login'),
    url(r'^logout', auth_views.logout, name='instagram.logout')
]
示例#13
0
文件: urls.py 项目: parul1931/mvp
from django.conf.urls import url
from views import RegisterView, LoginView

urlpatterns = [
    url(r'^register', RegisterView.as_view()),
    url(r'^login', LoginView.as_view()),
]
示例#14
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from django.views.generic import RedirectView
from emailusernames.forms import EmailAuthenticationForm
from django.contrib.auth.views import login

from views import RegisterView
from decorators import not_logged_in_required

urlpatterns = patterns('',
    url(r'^/login/$', not_logged_in_required(login),
        {'authentication_form': EmailAuthenticationForm}, name='login'),
    url(r'^/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
    url(r'^/password/reset/$', 'django.contrib.auth.views.password_reset',
        {'post_reset_redirect' : '/user/password/reset/done/', 'template_name': 'registration/password_reset_form.html', 'email_template_name': 'registration/password_reset_email.html'}, name='password_reset'),
    url(r'^/password/reset/done/$', 'django.contrib.auth.views.password_reset_done', {'template_name': 'registration/password_reset_done.html'}),
    url(r'^/password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm',
        {'post_reset_redirect' : '/user/password/done/'}),
    url(r'^/password/done/$', 'django.contrib.auth.views.password_reset_complete', {'template_name': 'registration/password_reset_complete.html'}),
    url(r'^/register/$', not_logged_in_required(RegisterView.as_view()),
        name='register'),
)
示例#15
0
文件: urls.py 项目: yz500223/xblog
"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin

from views import RegisterView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),

    # blog
    url(r'^blog/', include('blog.urls')),
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url('', include('django.contrib.auth.urls')),
]
示例#16
0
'''
Created on 2012-7-25

@author: TheBeet
'''
from django.conf.urls.defaults import patterns, url

from views import ajax_login, ajax_logout, UserDetailView, UserRankView, UserStatisticView, RegisterView

urlpatterns = patterns('',
    url(r'^login/$', ajax_login, name="login"),
    url(r'^logout/$', ajax_logout, name="logout"),
    url(r'^profile/(?P<slug>\w+)/$', UserDetailView.as_view(), name="detail"),
    url(r'^statistic/(?P<slug>\w+)/$', UserStatisticView.as_view(), name="statistic"),
    url(r'^rank/$', UserRankView.as_view(), name="rank"),
    url(r'^register/$', RegisterView.as_view(), name="register"),
)

示例#17
0
文件: urls.py 项目: jcarnide/Reach
from django.conf.urls import include, patterns, url
from views import RegisterView
from reach.settings import STATIC_ROOT

urlpatterns = patterns(
    "",
    url(r"^register/$", RegisterView.as_view(), name="register"),
    # url(r'^user/(?P<pk>\w+)/', userprofile_detail, name='userprofile-detail'),
)