Skip to content

airtonix/django-puraibeto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Puraibeto
================
by Zenobius Jiricek <airtonix@gmail.com>
http://github.com/airtonix/django-puraibeto/


Private Files for any Model

django-puraibeto is an application for attaching files to any
model and serving them conditionally.



Table of Contents
=================

  1 Installation
  2 Settings
  3 Models
    3.1 Permissions
  4 Middleware
  5 Views
  6 URLs
  7 Templates
  8 License


1 Installation
==============

  `pip install django-puraibeto`

  In order to use application, add `puraibeto' to INSTALLED_APPS in
  your django projects `settings.py' file.


1.1 Dependancies
================

  Puraibeto depends on some pivotal django apps :

    Guardian

      We use this for per object permissions, it's nice to be able to 
      say who can access what file.

    Surlex

      I'm lazy and dislike regex patterns all up in my url patterns, surlex
      makes it nice.

    Classy Tags

      Creating template tags can be messy and complicated, classy tags keeps
      it all neat and tidy.

    Appconf

      More of me being lazy.



2 Settings
==========



3 Models
========

  PrivateFile
    attached_to       : generic foreign key
    get_absolute_url  : reversed url to download
    can_user_view     : check if the supplied user is allowed to view the file in lists or detail
    can_user_download : check if the supplied user is allowed to download the file


3.1 Permissions
===============



3.2 Urls
========

  The way puraibeto deals with url routing is by providing a set of urlpatterns for you to anchor under your own url patterns that describe your models detail. for example :

  Lets say you have an urlconf with something like the following:

    surl(r'^awesome/<pk:#>/$',
      MyAwesomeDetailView.as_view(),
      name='awesome-detail'
    ),

  And you want to enable private file attachments for the model related to `MyAwesomeDetailView` (lets assume it's `MyAwesomeness` ) then in the same url patterns you'd also have :

    surl(r'^awesome/<attachedto_pk:#>/files/', include('puraibeto.urls')),


3.3 Views
=========



3.4 Templates
=============



4 License
=========

  This project is licensed all rights reserved. until further notice.

About

django-puraibeto is an application for attaching files to any model and serving them conditionally and efficiently via your webserver.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages