当前位置: 首页>>代码示例>>Python>>正文


Python FormView.as_view方法代码示例

本文整理汇总了Python中django.views.generic.FormView.as_view方法的典型用法代码示例。如果您正苦于以下问题:Python FormView.as_view方法的具体用法?Python FormView.as_view怎么用?Python FormView.as_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.views.generic.FormView的用法示例。


在下文中一共展示了FormView.as_view方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: url

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
from django.conf.urls import url, include
from django.views.generic import FormView, TemplateView

from polls import forms
from polls import views
from polls.rest import router

urlpatterns = [
    url(r'^$', views.PollListView.as_view(), name='poll_home'),
    url(r'^rest/', include(router.urls), name='rest'),
    url(r'^about/', views.AboutView.as_view(vistor="Changbin"), name='about'),
    url(r'^bootstrap3/', FormView.as_view(template_name='polls/bootstrap3.html', form_class=forms.MyRegistrationForm),
        name='bootstrap3'),
    url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'),
    url(r'^(?P<pk>\d+)/results/$', views.ResultsView.as_view(), name='results'),
    url(r'^(?P<poll_id>\d+)/vote/$', views.vote, name='vote'),
    url(r'^jinja2/$', TemplateView.as_view(template_name="polls/jinja.jinja2"), {'words': 'Hello, Jinja2.'},
        name='jinja2', ),
]
开发者ID:changbindu,项目名称:myDjango,代码行数:21,代码来源:urls.py

示例2: patterns

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
from django.conf.urls import patterns, url
from django.views.generic import FormView

from test_project.example_app.forms import Form1


urlpatterns = patterns('',
    url(r'^',
        FormView.as_view(
            template_name="example_app/form1.html",
            form_class=Form1,
        ),
        name="form1"),
)
开发者ID:lerela,项目名称:django-zenaida,代码行数:16,代码来源:urls.py

示例3: as_view

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
 def as_view(cls, **kwargs):
     return csrf_exempt(FormView.as_view(**kwargs))
开发者ID:XanderDwyl,项目名称:paperless,代码行数:4,代码来源:views.py

示例4: patterns

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
# -*- coding: utf-8 -*-
from datetime import datetime
from django.conf.urls import patterns, url
from django.views.generic import FormView
from calendario.forms import SetupForm

urlpatterns = patterns('calendario',
   url(r'^$', FormView.as_view(template_name='setup.html', form_class=SetupForm, initial={'semanas': 16, 'fecha_de_inicio': datetime.today()}), name='setup'),
   url(r'^create/$', 'views.create',  name='create'),
)
开发者ID:gsorianob,项目名称:materias,代码行数:12,代码来源:urls.py

示例5: patterns

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
from django.conf.urls import patterns, url
from django.views.generic import TemplateView, FormView
from forms import ExampleForm

urlpatterns = patterns('',
    url(r'^$', FormView.as_view(template_name='example.html', form_class=ExampleForm))
)
开发者ID:neomanic,项目名称:django-dropzone,代码行数:9,代码来源:urls.py

示例6: patterns

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url, include
from django.views.generic import FormView
from forms import UploadForm, UploadModelForm

urlpatterns = patterns('',
    (r'^form/', FormView.as_view(form_class=UploadForm,
        						 template_name="testmain/form.html",
        						 success_url="/testapp/form")),
    (r'^modelform/', FormView.as_view(form_class=UploadModelForm,
        						      template_name="testmain/form.html",
        						      success_url="/testapp/modelform"))
)
开发者ID:CydarLtd,项目名称:django-progressbarupload,代码行数:15,代码来源:urls.py

示例7: TestForm

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
from django.conf.urls import patterns, url
from django import forms
from django.views.generic import FormView


class TestForm(forms.Form):
    """An arbitrary form using most of available fields"""

    date = forms.DateField()
    date_time = forms.DateTimeField()
    time = forms.TimeField()
    number = forms.IntegerField()
    email = forms.EmailField()
    url = forms.URLField()


urlpatterns = patterns(
    "",
    # Examples:
    url(r"^$", FormView.as_view(template_name="home.html", form_class=TestForm)),
    # url(r'^demo_project/', include('demo_project.foo.urls')),
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)
开发者ID:rizwanmeo,项目名称:django_reform,代码行数:28,代码来源:urls.py

示例8: url

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
		'django.contrib.auth.views.login',
		{'template_name' : 'common/login.html'}
	),

	url(r'^logout/$',
		'django.contrib.auth.views.logout',
		{'template_name' : 'common/logout.html'}
	),

	url(r'^dev/delete/$',
		'message.views.dev_delete'
	),

	url(r'^user/form/$',
		FormView.as_view(
			form_class = UserForm,
			template_name = 'user/form.html'
		)
	),

	url(r'^user/create/$',
		CreateView.as_view(
			form_class = UserForm,
			template_name = 'user/form.html',
			success_url = '/user/form'
		)
	),

	url(r'^message/(\d+)/(\w*)$',
		MessageFormView.as_view()
	),
开发者ID:tenshiPure,项目名称:chat,代码行数:33,代码来源:urls.py

示例9: patterns

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]


urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'phone_application.views.home', name='home'),
    # url(r'^phone_application/', include('phone_application.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    
    
    url(r'^$', FormView.as_view(template_name="home.html",form_class = ProductForm ),name="home"),      
    url(r'^integrate_database/(?P<last_date>'+datetime_pattern+')$', IntegrateDatabase.as_view(), name="integrate_database"),
    url(r'^detail_offline/$', TemplateView.as_view(template_name="detail_offline.html"),name="detail_offline"), 
    
    url(r'^manifest\.appcache$', ManifestView.as_view(), name="cache_manifest"),

    )

    
      
    
    
    
    
    
    
开发者ID:nashirav,项目名称:phone_application,代码行数:23,代码来源:urls.py

示例10: patterns

# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import as_view [as 别名]
# -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals

from django.conf.urls import include, patterns, url
from django.views.generic import FormView

from . import forms, views

urlpatterns = patterns(
    '',
    url(r'^s3file/', include('s3file.urls')),
    url(r'^s3/$',
        views.S3MockView.as_view(), name='s3mock'),
    url(r'^upload/$',
        FormView.as_view(form_class=forms.UploadForm, template_name='form.html'), name='upload'),
)
开发者ID:gitter-badger,项目名称:django-s3file,代码行数:18,代码来源:urls.py


注:本文中的django.views.generic.FormView.as_view方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。