Make primary_key optional.

The pwpolicy plugin doesn't have a primary key but can still take advantage
of other parts of the framework.
This commit is contained in:
Rob Crittenden 2009-10-02 09:29:22 -04:00 committed by Jason Gerard DeRose
parent 48785a5af1
commit 97dfa586de

View File

@ -29,7 +29,8 @@ class Create(frontend.Method):
"""
def get_args(self):
yield self.obj.primary_key.clone(attribute=True)
if self.obj.primary_key:
yield self.obj.primary_key.clone(attribute=True)
def get_options(self):
if self.extra_options_first:
@ -48,7 +49,8 @@ class PKQuery(frontend.Method):
"""
def get_args(self):
yield self.obj.primary_key.clone(attribute=True, query=True)
if self.obj.primary_key:
yield self.obj.primary_key.clone(attribute=True, query=True)