Message from discussion Repositories
Received: by 10.220.122.23 with SMTP id j23mr813901vcr.9.1302941925951;
Sat, 16 Apr 2011 01:18:45 -0700 (PDT)
Received: by 10.220.173.66 with SMTP id o2ls361631vcz.5.gmail; Sat, 16 Apr
2011 01:18:43 -0700 (PDT)
Received: by 10.220.178.6 with SMTP id bk6mr160200vcb.3.1302941923781; Sat, 16
Apr 2011 01:18:43 -0700 (PDT)
Received: by w36g2000vbi.googlegroups.com with HTTP; Sat, 16 Apr 2011 01:18:43
Date: Sat, 16 Apr 2011 01:18:43 -0700 (PDT)
X-HTTP-UserAgent: Mozilla/5.0 (Linux; U; Android 2.2; en-pl; Desire_A8181
Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1,gzip(gfe)
Subject: Re: Repositories
From: Piotr Solnica <piotr.soln...@gmail.com>
To: DataMapper <email@example.com>
Content-Type: text/plain; charset=ISO-8859-1
You just need to define
self.default_repository_name; :other_repo_name;end at the beginning of
your model declaration.
For readonly models you can check out dm-is-read_only plugin.
On Apr 16, 6:37=A0am, Michishige Kaito <chris.webs...@gmail.com> wrote:
> I came across the need to define a secondary repository, to access a set
> of data handled by another application. Now, there are two things I
> couldn't find in the API docs.
> One, can I set a model to belong to a
> certain repository, in the model declaration, so it doesn't get created
> elsewhere upon running migrations, and so I don't have to wrap all calls
> to it with DataMapper.repository()?
> And two, since I'm accessing data handled by another app, it would
> certainly be handy if the models I create for this could be read-only.