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 Database access pattern

Received: by 10.68.219.170 with SMTP id pp10mr16363128pbc.1.1338976800744;
        Wed, 06 Jun 2012 03:00:00 -0700 (PDT)
X-BeenThere: pylons-discuss@googlegroups.com
Received: by 10.68.233.8 with SMTP id ts8ls19866241pbc.7.gmail; Wed, 06 Jun
 2012 02:59:55 -0700 (PDT)
Received: by 10.68.194.168 with SMTP id hx8mr1875916pbc.5.1338976795473;
        Wed, 06 Jun 2012 02:59:55 -0700 (PDT)
Date: Wed, 6 Jun 2012 02:59:54 -0700 (PDT)
From: tanshu <tan...@gmail.com>
To: pylons-discuss@googlegroups.com
Message-Id: <b791502d-d064-4ef9-8b2a-eeb8f7d0bcdb@googlegroups.com>
In-Reply-To: <CAAPh5FkNMHBZ9i2QjmiGsumTT1KZ0pXTY8O1GvYmT=8eh+PPuA@mail.gmail.com>
References: <28c82f68-a088-49ef-9d81-4629262e69df@googlegroups.com>
 <CAAPh5FkNMHBZ9i2QjmiGsumTT1KZ0pXTY8O1GvYmT=8eh+PPuA@mail.gmail.com>
Subject: Re: Database access pattern
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1155_17628314.1338976794584"

------=_Part_1155_17628314.1338976794584
Content-Type: multipart/alternative; 
	boundary="----=_Part_1156_26996821.1338976794584"

------=_Part_1156_26996821.1338976794584
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Thanks malthe for.
I read that documentation and am using the same, but my question was about 
where these statements should be put?  In the view, a separate class (eg. 
DAL pattern), or in the Model? 
Coming from a n-tier application developer, I am unable to figure out how 
to improve maintainability of the application and reduce duplication.  I 
was hoping that someone could point me to a guide of the way to do these 
things in pyramid or just share with me how they do things. :)

In the meanwhile, I was looking at the reddit source, and I think that they 
do it in the models.  In your opinion is it the right way? Any help would 
be greatly appreciated.

Thanks for your reply.  
tanshu

On Wednesday, June 6, 2012 3:21:11 PM UTC+5:30, malthe wrote:
>
> http://docs.sqlalchemy.org/en/latest/orm/tutorial.html 
>
> That's assuming you're using SQL. 
>
> \malthe 
>
> On 6 June 2012 09:50, tanshu <tan...@gmail.com> wrote: 
> > Hi, 
> > I am sorry if this has been asked before, but I couldn't find the answer 
> > anywhere.  I am relatively new to python / pyramid and have developed a 
> few 
> > test programs.  I come from a C# background and could not figure out 
> what 
> > the best pattern is to lay out database access. 
> > 
> > In C# etc, you create separate dal classes and go with n-tier 
> architecture, 
> > should I just the validation, save, update in the controller in pyramid 
> or 
> > create separate classes.  Any help will be gratefully appreciated. 
> > 
> > Thanks in advance. :) 
> > 
> > tanshu 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "pylons-discuss" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/pylons-discuss/-/5-_3loZtH5wJ. 
> > To post to this group, send email to pylons-discuss@googlegroups.com. 
> > To unsubscribe from this group, send email to 
> > pylons-discuss+unsubscribe@googlegroups.com. 
> > For more options, visit this group at 
> > http://groups.google.com/group/pylons-discuss?hl=en. 
>

------=_Part_1156_26996821.1338976794584
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Thanks malthe for.<div>I read that documentation and am using the same, but=
 my question was about where these statements should be put? &nbsp;In the v=
iew, a separate class (eg. DAL pattern), or in the Model?&nbsp;</div><div>C=
oming from a n-tier application developer, I am unable to figure out how to=
 improve maintainability of the application and reduce duplication. &nbsp;I=
 was hoping that someone could point me to a guide of the way to do these t=
hings in pyramid or just share with me how they do things. :)</div><div><br=
></div><div>In the meanwhile, I was looking at the reddit source, and I thi=
nk that they do it in the models. &nbsp;In your opinion is it the right way=
? Any help would be greatly appreciated.</div><div><br></div><div>Thanks fo=
r your reply. &nbsp;<br>tanshu</div><div><br>On Wednesday, June 6, 2012 3:2=
1:11 PM UTC+5:30, malthe wrote:<blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
><a href=3D"http://docs.sqlalchemy.org/en/latest/orm/tutorial.html" target=
=3D"_blank">http://docs.sqlalchemy.org/en/<wbr>latest/orm/tutorial.html</a>
<br>
<br>That's assuming you're using SQL.
<br>
<br>\malthe
<br>
<br>On 6 June 2012 09:50, tanshu &lt;<a href=3D"mailto:tan...@gmail.com" ta=
rget=3D"_blank">tan...@gmail.com</a>&gt; wrote:
<br>&gt; Hi,
<br>&gt; I am sorry if this has been asked before, but I couldn't find the =
answer
<br>&gt; anywhere. &nbsp;I am relatively new to python / pyramid and have d=
eveloped a few
<br>&gt; test programs. &nbsp;I come from a C# background and could not fig=
ure out what
<br>&gt; the best pattern is to lay out database access.
<br>&gt;
<br>&gt; In C# etc, you create separate dal classes and go with n-tier arch=
itecture,
<br>&gt; should I just the validation, save, update in the controller in py=
ramid or
<br>&gt; create separate classes. &nbsp;Any help will be&nbsp;gratefully&nb=
sp;appreciated.
<br>&gt;
<br>&gt; Thanks in advance. :)
<br>&gt;
<br>&gt; tanshu
<br>&gt;
<br>&gt; --
<br>&gt; You received this message because you are subscribed to the Google=
 Groups
<br>&gt; "pylons-discuss" group.
<br>&gt; To view this discussion on the web visit
<br>&gt; <a href=3D"https://groups.google.com/d/msg/pylons-discuss/-/5-_3lo=
ZtH5wJ" target=3D"_blank">https://groups.google.com/d/<wbr>msg/pylons-discu=
ss/-/5-_<wbr>3loZtH5wJ</a>.
<br>&gt; To post to this group, send email to <a href=3D"mailto:pylons-disc=
uss@googlegroups.com" target=3D"_blank">pylons-discuss@googlegroups.<wbr>co=
m</a>.
<br>&gt; To unsubscribe from this group, send email to
<br>&gt; <a href=3D"mailto:pylons-discuss%2Bunsubscribe@googlegroups.com" t=
arget=3D"_blank">pylons-discuss+unsubscribe@<wbr>googlegroups.com</a>.
<br>&gt; For more options, visit this group at
<br>&gt; <a href=3D"http://groups.google.com/group/pylons-discuss?hl=3Den" =
target=3D"_blank">http://groups.google.com/<wbr>group/pylons-discuss?hl=3De=
n</a>.
<br></blockquote></div>
------=_Part_1156_26996821.1338976794584--

------=_Part_1155_17628314.1338976794584--