Re: git?

2011-02-22 Thread Kyle Terry
Kyle Terry | www.kyleterry.com On Mon, Feb 21, 2011 at 8:41 PM, Joe Dallago wrote: > I just wanted to chime in and thank Kyle for that link to progit.org. > The other day, I tried searching for an all inclusive online resource > to explain every detail of git to me, and came up empty handed. >

"user objects"

2011-02-22 Thread Chris Withers
Hi All, Suppose I have a user object that behaves something like: class User: def __init__(self,name,password): self.name,self.password = name,password def authenticate(self,password): return self.password==password def allowed(self,permission): ... stuff ... Now, for the s

Re: "user objects"

2011-02-22 Thread Andrey Popp
On Feb 22, 2011, at 12:12 PM, Chris Withers wrote: > If, say, I instantiate this user in the authentication middlewear, where's > there "right" place to put this user object so that I don't have to > instantiate it again when I need it for the authentication and authorization > policies? You c

Re: "user objects"

2011-02-22 Thread Wichert Akkerman
On 2/22/11 10:12 , Chris Withers wrote: Hi All, Suppose I have a user object that behaves something like: class User: def __init__(self,name,password): self.name,self.password = name,password def authenticate(self,password): return self.password==password def allowed(self,permission): ... st

Re: "user objects"

2011-02-22 Thread Chris McDonough
http://docs.pylonsproject.org/projects/pyramid_cookbook/dev/authentication.html may help. - C On Tue, 2011-02-22 at 09:12 +, Chris Withers wrote: > Hi All, > > Suppose I have a user object that behaves something like: > > class User: > >def __init__(self,name,password): > self.n

Re: Deform readonly fields

2011-02-22 Thread Daniel Holth
I did something like this too. I need to be able to show readonly fields in my forms in the same way I do in formish, so I implemented a per-field readonly flag. It works okay but it is a little cumbersome to specify which fields are readonly: deform/field.py: def serialize(self, cstruct, re

Re: "user objects"

2011-02-22 Thread Daniel Holth
If you do it properly, you can .get(primary_key) the user from the SQLAlchemy session and it only hits the storage once per transaction. If the object hasn't been garbage collected, subsequent .get() calls will hit the identity map, which can be used as a kind of cache but which is really there

Re: default permission overriding

2011-02-22 Thread Alice Bevan–McGregor
Create an empty object instance called NoDefault and use that in place of None, allowing None to be passed as a legitimate value. My 2¢. — Alice. On 2011-02-19 11:53:21 -0800, danjac...@gmail.com said: As an aside, it would be a good idea to have a constant value instead of "__no_p

Re: default permission overriding

2011-02-22 Thread Chris Withers
On 22/02/2011 20:17, Alice Bevan–McGregor wrote: Create an empty object instance called NoDefault and use that in place of None, allowing None to be passed as a legitimate value. My 2¢. My 2p too :-) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting -

Re: default permission overriding

2011-02-22 Thread Daniel Holth
There is a constant. It is called pyramid.interfaces.NO_PERMISSION_REQUIRED ; however, the string is documented. This probably makes the documentation shorter because you would have to use the string if you are configuring with ZCML. This is /only/ required at all when you need your application to

Re: Global variables

2011-02-22 Thread Iain Duncan
On Sat, Feb 19, 2011 at 12:09 AM, Chris Withers wrote: > A bit late in on this one, sorry: > > > > On 18/02/2011 23:15, Iain Duncan wrote: > >> > > Some of us *do* write apps that expect to be extended / >>reconfigured via >> > > the ZCA registry, but Pyramid itself doesn't mandate th

make repoze.who respond to 403 Forbidden

2011-02-22 Thread Iain Duncan
I'm porting a bfg framework extension to pyramid, and auth was handled by repoze.who with a custom authentication plugin. I see from the release notes ( and my apps behaviour ) that I now need to make repoze.who react to 403's by presenting it's login challenge. However, I'm not at the point of tho

Re: Raw MySQL with SQLAlchemy using Pyramid framework

2011-02-22 Thread Iain Duncan
One more vote that it's absolutely worth learning SA even if you're an sql whiz. It's a superb library, and let's you operate at multiple levels of abstraction. And great sql injection insurance! iain On Sun, Feb 20, 2011 at 8:39 AM, Ben Bangert wrote: > On Feb 20, 2011, at 1:58 AM, AwaisMuzaff

Re: make repoze.who respond to 403 Forbidden

2011-02-22 Thread Chris McDonough
On Tue, 2011-02-22 at 20:29 -0800, Iain Duncan wrote: > I'm porting a bfg framework extension to pyramid, and auth was handled > by repoze.who with a custom authentication plugin. I see from the > release notes ( and my apps behaviour ) that I now need to make > repoze.who react to 403's by present

Re: make repoze.who respond to 403 Forbidden

2011-02-22 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/22/2011 11:29 PM, Iain Duncan wrote: > I'm porting a bfg framework extension to pyramid, and auth was handled by > repoze.who with a custom authentication plugin. I see from the release notes > ( and my apps behaviour ) that I now need to make r

Re: make repoze.who respond to 403 Forbidden

2011-02-22 Thread Iain Duncan
On Tue, Feb 22, 2011 at 8:36 PM, Chris McDonough wrote: > On Tue, 2011-02-22 at 20:29 -0800, Iain Duncan wrote: > > I'm porting a bfg framework extension to pyramid, and auth was handled > > by repoze.who with a custom authentication plugin. I see from the > > release notes ( and my apps behaviou