Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
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)
X-BeenThere: datamapper@googlegroups.com
Received: by 10.220.173.66 with SMTP id o2ls361631vcz.5.gmail; Sat, 16 Apr
 2011 01:18:43 -0700 (PDT)
MIME-Version: 1.0
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
 -0700 (PDT)
Date: Sat, 16 Apr 2011 01:18:43 -0700 (PDT)
In-Reply-To: <alpine.LNX.2.02.1104160533100.3808@localhost.localdomain>
X-IP: 46.134.23.244
References: <alpine.LNX.2.02.1104160533100.3808@localhost.localdomain>
User-Agent: G2/1.0
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)
Message-ID: <1fb8e3ee-6acc-4927-80c3-e6a7f114c861@w36g2000vbi.googlegroups.com>
Subject: Re: Repositories
From: Piotr Solnica <piotr.soln...@gmail.com>
To: DataMapper <datamapper@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

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.

Cheers

# solnic

On Apr 16, 6:37=A0am, Michishige Kaito <chris.webs...@gmail.com> wrote:
> Hey,
>
> 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.
>