Do me the issue is, should all data always be filtered by hospital.
If there should only be filtered in some cases and not in other, use 
explicit queries
If some tables are always filtered and some are not, you may want to use 
the tenant feature.

On Thursday, 28 June 2012 05:45:13 UTC-5, Ovidio Marinho wrote:
>
> I can not split into separate database, as the management reports need 
> to filter all information. What I need is that the data are shown to 
> hosptal (1) is only seen by him. No problem if all hospitals being in 
> the same database, so is the question of security in view. When the 
> login Hospital (1) is made only data related to hospital (1) should 
> appear on the screen. 
>
>
>
>
>        Ovidio Marinho Falcao Neto 
>                 Web Developer 
>              [email protected] 
>           [email protected] 
>                  ITJP - itjp.net.br 
>                83   8826 9088 - Oi 
>                83   9334 0266 - Claro 
>                         Brasil 
>
>
>
> 2012/6/27 Massimo Di Pierro <[email protected]>: 
> > I would suggest you use a different database (a different connection 
> string) 
> > for each hospital depending on the hostname. 
> > 
> > <hospital>.domain.com 
> > import re; regex = re.compile('.*\://(.*?)/.* 
> > db = DAL('postgresq://..../%s' % 
> > regex.match(request.env.http_host).group(1)) 
> > 
> > In this way you keep your data separate (which is better for security) 
> and 
> > will allow you scale horizontally by setting up multiple db server 
> > instances. 
> > 
> > 
> > 
> > On Wednesday, 27 June 2012 18:07:44 UTC-5, Ovidio Marinho wrote: 
> >> 
> >> I am making an application to control government medical appointments 
> >> in more than fifty hospitals all use a single postgres database, but 
> >> each hospital must have administrator access, Operator and User, and 
> >> each access must be made with the view of their unique data . 
> >> 
> >> is this. 
> >> 
> >> 
> > 
>

Reply via email to