當前位置: 首頁>>代碼示例>>Python>>正文


Python DavView.as_view方法代碼示例

本文整理匯總了Python中djangodav.views.DavView.as_view方法的典型用法代碼示例。如果您正苦於以下問題:Python DavView.as_view方法的具體用法?Python DavView.as_view怎麽用?Python DavView.as_view使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在djangodav.views.DavView的用法示例。


在下文中一共展示了DavView.as_view方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: patterns

# 需要導入模塊: from djangodav.views import DavView [as 別名]
# 或者: from djangodav.views.DavView import as_view [as 別名]
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with DjangoDav.  If not, see <http://www.gnu.org/licenses/>.
from djangodav.acls import FullAcl
from djangodav.locks import DummyLock

from djangodav.views import DavView

from django.conf.urls import patterns

from samples.fs.resources import TempDirWebDavResource
from samples.db.resources import MyDBDavResource
from samples.auth.views.rest import RestAuthDavView
from samples.auth.views.tasty import TastyAuthDavView


urlpatterns = patterns('',
    # Mirroring tmp folder
    (r'^fs(?P<path>.*)$', DavView.as_view(resource_class=TempDirWebDavResource, lock_class=DummyLock, acl_class=FullAcl)),
    # Db file keeper
    (r'^db(?P<path>.*)$', DavView.as_view(resource_class=MyDBDavResource, lock_class=DummyLock, acl_class=FullAcl)),

    # REST framework auth
    (r'^auth/rest(?P<path>.*)$', RestAuthDavView.as_view(resource_class=TempDirWebDavResource, lock_class=DummyLock, acl_class=FullAcl)),
    # Tastypie auth
    (r'^auth/tasty(?P<path>.*)$', TastyAuthDavView.as_view(resource_class=TempDirWebDavResource, lock_class=DummyLock, acl_class=FullAcl)),
)
開發者ID:PKUbuntu,項目名稱:djangodav,代碼行數:32,代碼來源:urls.py


注:本文中的djangodav.views.DavView.as_view方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。