Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/airtonix/django-puraibeto
django-puraibeto is an application for attaching files to any model and serving them conditionally and efficiently via your webserver.
https://github.com/airtonix/django-puraibeto
Last synced: 10 days ago
JSON representation
django-puraibeto is an application for attaching files to any model and serving them conditionally and efficiently via your webserver.
- Host: GitHub
- URL: https://github.com/airtonix/django-puraibeto
- Owner: airtonix
- Created: 2013-04-17T09:29:01.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-09T00:19:52.000Z (over 11 years ago)
- Last Synced: 2024-05-21T03:17:25.912Z (8 months ago)
- Language: Python
- Size: 309 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Django Puraibeto
================
by Zenobius Jiricek
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 License1 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 file3.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//$',
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//files/', include('puraibeto.urls')),
3.3 Views
=========3.4 Templates
=============4 License
=========This project is licensed all rights reserved. until further notice.