Skip to content

Commit 74cad61

Browse files
committed
0.10.11 : mixin
1 parent a75f94b commit 74cad61

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

osis_document/contrib/mixins.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ##############################################################################
2+
#
3+
# OSIS stands for Open Student Information System. It's an application
4+
# designed to manage the core business of higher education institutions,
5+
# such as universities, faculties, institutes and professional schools.
6+
# The core business involves the administration of students, teachers,
7+
# courses, programs and so on.
8+
#
9+
# Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
10+
#
11+
# This program is free software: you can redistribute it and/or modify
12+
# it under the terms of the GNU General Public License as published by
13+
# the Free Software Foundation, either version 3 of the License, or
14+
# (at your option) any later version.
15+
#
16+
# This program is distributed in the hope that it will be useful,
17+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
# GNU General Public License for more details.
20+
#
21+
# A copy of this license - GNU General Public License - is available
22+
# at the root of the source code of this program. If not,
23+
# see http://www.gnu.org/licenses/.
24+
#
25+
# ##############################################################################
26+
from osis_document.contrib import FileField
27+
28+
29+
class FileFieldModelMixin:
30+
"""
31+
A mixin that provides a property to get all FileField field names of a model.
32+
"""
33+
@property
34+
def document_fields(self):
35+
return [
36+
field.name for field in self._meta.get_fields()
37+
if isinstance(field, FileField)
38+
]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
setup(
2929
name='OSIS Document',
30-
version='0.10.9',
30+
version='0.10.11',
3131
description='Document management API and widget',
3232
url='http://github.com/uclouvain/osis-document',
3333
author='Université catholique de Louvain',

0 commit comments

Comments
 (0)