Hi all,

I'm not sure if this is the right place to ask, but I'll try anyway :)

Having a model that has a constructor, how can I write a fixture for it?

For example:

class Language(Base):

     __tablename__   = 'languages'

     id      = Column(Integer, primary_key=True)
     code    = Column(String(2), nullable=False, unique=True)

     def __init__(self, code):
         self.code = code

class LanguageData(DataSet):

        class en:
                code = 'en'

The class above isn't correct and it'll fail loading data with

fixture.exc.LoadError: TypeError: __init__() takes exactly 2 arguments 
(1 given)

Are there any ways to sort this out? Is it a bad practice to have such 
models

Thanks in advance,
Drozd Nikolai


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to