Skip to content

Commit

Permalink
fixed by run some
Browse files Browse the repository at this point in the history
  • Loading branch information
UnDarkle committed Oct 16, 2018
1 parent 71d7ff0 commit 7a91c8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rotest/management/models/resource_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from django.db import models
from django.utils import six
from django.db.models import Field
from django.db.models.base import ModelBase
from django.contrib.auth import models as auth_models
from django.core.exceptions import ObjectDoesNotExist, ValidationError
Expand All @@ -28,8 +29,9 @@ def __init__(self, field_name):
class DataBase(ModelBase):
"""Metaclass that creates data pointers for django fields."""
def add_to_class(cls, name, value):
ModelBase.add_to_class(cls, name, value)
if hasattr(value, 'contribute_to_class'):
super_add = super(DataBase, cls).add_to_class
super_add(name, value)
if isinstance(value, Field) and hasattr(value, 'contribute_to_class'):
setattr(cls, name, DataPointer(name))


Expand Down

0 comments on commit 7a91c8d

Please sign in to comment.