Hi Marlin and Pavel, thanks for the response.

No, I'm not using super(). I can't find any documentation on this
class. Could you point me towards some? An example of what I mean is
below. The class below won't be able to create new rows in the admin
interface unless I comment out the three lines of the __init__ method.
It fails with an error like "class 'Company' requires three
arguements, only one given."

class Company(DeclarativeBase):
    __tablename__ = 'companies'

    id = Column(Integer, primary_key = True)
    name = Column(String, nullable = False)
    company_symbol = Column(String)

    def __init__(self, name, company_symbol):
        self.name = name
        self.company_symbol = company_symbol

    def __repr__(self):
        return "<Company('%s', '%s')>" % self.name,
self.company_symbol

Kind regards

Hansel

On Jan 13, 2:24 pm, Pavel Strashkin <[email protected]> wrote:
> Hi,
>
> Could you please provide an example? Do you call superclass __init__
> method in your class?
>
> 2011/1/13 Hansel Dunlop <[email protected]>:
>
>
>
> > Hi there,
>
> > First off I want to say thank you to everyone that has spent their time
> > developing the TurboGears stack. It's great!
>
> > I have one question, or maybe it's a comment.
>
> > If you create your data models with '__init__' methods then the admin
> > interface is no longer able to add rows into the database. Is this by
> > design? I am just curious about the rationale and how it can be easily
> > changed.
>
> > Kind regards
>
> > Hansel
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "TurboGears" 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/turbogears?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to