Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
fixtures
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Nikolai Drozd  
View profile   Translate to Translated (View Original)
 More options 9 Nov, 11:26
From: Nikolai Drozd <dniko...@gmail.com>
Date: Mon, 09 Nov 2009 13:26:00 +0200
Subject: fixtures
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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bangert  
View profile   Translate to Translated (View Original)
 More options 19 Nov, 07:04
From: Ben Bangert <b...@groovie.org>
Date: Wed, 18 Nov 2009 23:04:40 -0800
Local: Thurs 19 Nov 2009 07:04
Subject: Re: fixtures
On Nov 9, 2009, at 3:26 AM, Nikolai Drozd wrote:

> 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?

I found this page:
http://farmdev.com/projects/fixture/using-fixture-with-pylons.html

Fixture is a project created to make fixture for db models. I haven't used it myself, but it looks good.

Cheers,
Ben


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google