forked from rouxcode/django-filer-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
163 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
include LICENSE | ||
include README.rst | ||
include README.md | ||
include PYPI.rst | ||
global-exclude *.orig *.pyc *.log *.swp | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# django-filer-addons-addons | ||
|
||
|
||
[![Build Status](https://travis-ci.org/bnzk/django-filer-addons.svg "Build Status")](https://travis-ci.org/bnzk/django-filer-addons/) | ||
[![PyPi Version](https://img.shields.io/pypi/v/django-filer-addons.svg "PyPi Version")](https://pypi.python.org/pypi/django-filer-addons/) | ||
[![Licence](https://img.shields.io/pypi/l/django-filer-addons.svg "Licence")](https://pypi.python.org/pypi/django-filer-addons/) | ||
|
||
various django-filer enhancements / bugfixes. Fair warning: parts of this package might not be | ||
best practiced or very efficient (that said, can cause performance issues!), but are implemented | ||
as we needed this functionality, and as filer development sometimes | ||
seems to stall, it is was implemented just to make it work. Part of this package might even get merged | ||
into filer (someday..). | ||
|
||
Features | ||
-------- | ||
|
||
This package provides sub applications, that can be installed individually, to only selecte the | ||
needed features. | ||
|
||
- `filer_addons.filer_gui` - an improved filer file and filer image field, a multiupload inline. | ||
- `filer_addons.filer_signals` - can help avoid duplicates, will rename files on the filesystem if | ||
said to do so, and can put unfiled files in a default folder, to prevent permission issues. | ||
- `filer_addons.filer_utils` - various helpers: for now, generate folder/filenames for uploaded | ||
files (without folder/8-char simple uuid4/use db folder/year/year-month) | ||
|
||
Install | ||
------- | ||
|
||
TODO | ||
|
||
Usage | ||
----- | ||
|
||
TODO | ||
|
||
**filer_gui** | ||
|
||
**filer_signals** | ||
|
||
**filer_utils** |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.test import TestCase | ||
from filer.tests import create_superuser | ||
from filer.models import File, Folder | ||
|
||
from filer_addons.tests.utils import create_django_file | ||
|
||
|
||
class ManagementCommandsTests(TestCase): | ||
def setUp(self): | ||
self.superuser = create_superuser() | ||
self.client.login(username='admin', password='secret') | ||
self.folder = Folder.objects.create(name='test') | ||
self.another_folder = Folder.objects.create(name='test') | ||
|
||
def tearDown(self): | ||
self.delete_files() | ||
for folder in Folder.objects.all(): | ||
folder.delete() | ||
|
||
def delete_files(self): | ||
for f in File.objects.all(): | ||
f.delete() | ||
|
||
def create_file(self, **kwargs): | ||
""" | ||
two files | ||
kwargs size: tuple, img dimension | ||
kwargs name: filename | ||
:param kwargs: | ||
:return: | ||
""" | ||
filename = 'file.jpg' | ||
if kwargs.get('name', None): | ||
filename = kwargs['name'] | ||
size = (50, 50, ) | ||
if kwargs.get('size', None): | ||
size = kwargs['size'] | ||
django_file = create_django_file(filename=filename, size=size) | ||
file_obj = File.objects.create( | ||
owner=self.superuser, | ||
original_filename=filename, | ||
file=django_file, | ||
) | ||
file_obj.save() | ||
return file_obj | ||
|
||
# TODO: write tests! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[flake8] | ||
max-line-length=80 | ||
exclude = .git,node_modules/*,*/migrations/*,*/static/CACHE/*,*/south_migrations/* | ||
exclude = .git,node_modules/*,.tox/*,*/migrations/*,*/static/CACHE/*,*/south_migrations/* |