django-eav2/__init__.py
2010-09-23 15:51:59 +03:00

44 lines
1.6 KiB
Python

#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 coding=utf-8
#
# This software is derived from EAV-Django originally written and
# copyrighted by Andrey Mikhaylenko <http://pypi.python.org/pypi/eav-django>
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with EAV-Django. If not, see <http://gnu.org/licenses/>.
VERSION = (0, 9, 0, "dev", 'a')
def get_version():
if VERSION[3] == "final":
return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
elif VERSION[3] == "dev":
if VERSION[2] == 0:
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[3], VERSION[4])
return "%s.%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3], VERSION[4])
else:
return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])
__version__ = get_version()
def register(model_cls, config_cls=None):
from registry import Registry, EavConfig
config_cls = config_cls or EavConfig
Registry.register(model_cls, config_cls)
def unregister(model_cls):
from registry import Registry
Registry.unregister(model_cls)