forked from openlp/openlp
Remove code redefinitions
This commit is contained in:
parent
14307fcc8a
commit
e9904754c2
@ -35,22 +35,6 @@ from openlp.core.lib import SettingsManager
|
|||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.bibles.lib.models import *
|
from openlp.plugins.bibles.lib.models import *
|
||||||
|
|
||||||
class BaseModel(object):
|
|
||||||
"""
|
|
||||||
BaseModel provides a base object with a set of generic functions
|
|
||||||
"""
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def populate(cls, **kwargs):
|
|
||||||
"""
|
|
||||||
Creates an instance of a class and populates it, returning the instance
|
|
||||||
"""
|
|
||||||
me = cls()
|
|
||||||
keys = kwargs.keys()
|
|
||||||
for key in keys:
|
|
||||||
me.__setattr__(key, kwargs[key])
|
|
||||||
return me
|
|
||||||
|
|
||||||
class TBibleMeta(BaseModel):
|
class TBibleMeta(BaseModel):
|
||||||
"""
|
"""
|
||||||
Bible Meta Data
|
Bible Meta Data
|
||||||
|
@ -75,21 +75,6 @@ temp_authors_songs_table = Table(u'songauthors_temp', metadata,
|
|||||||
Column(u'authorid', types.Integer, primary_key=True),
|
Column(u'authorid', types.Integer, primary_key=True),
|
||||||
Column(u'songid', types.Integer)
|
Column(u'songid', types.Integer)
|
||||||
)
|
)
|
||||||
class BaseModel(object):
|
|
||||||
"""
|
|
||||||
BaseModel provides a base object with a set of generic functions
|
|
||||||
"""
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def populate(cls, **kwargs):
|
|
||||||
"""
|
|
||||||
Creates an instance of a class and populates it, returning the instance
|
|
||||||
"""
|
|
||||||
me = cls()
|
|
||||||
keys = kwargs.keys()
|
|
||||||
for key in keys:
|
|
||||||
me.__setattr__(key, kwargs[key])
|
|
||||||
return me
|
|
||||||
|
|
||||||
class TAuthor(BaseModel):
|
class TAuthor(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user