Added license to __init__ and fixed nosetests

This commit is contained in:
David Gelvin 2010-09-23 13:05:40 +03:00
parent 8cc8e40245
commit e5d83e365a
3 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,20 @@
#!/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/>.

View file

@ -26,11 +26,11 @@ from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.conf import settings
from .validators import *
from .fields import EavSlugField, EavDatatypeField
def get_unique_class_identifier(cls):
'''
Return a unique identifier for a class
@ -350,3 +350,12 @@ class Entity(object):
config_cls = EavRegistry.get_config_cls_for_model(sender)
entity = getattr(kwargs['instance'], config_cls.eav_attr)
entity.validate_attributes()
if 'django_nose' in settings.INSTALLED_APPS:
'''
The django_nose test runner won't automatically create our Patient model
database table which is required for tests, unless we import it here.
Please, someone tell me a better way to do this.
'''
from .tests.models import Patient

View file

@ -9,4 +9,4 @@ class Patient(models.Model):
def __unicode__(self):
return self.name