Permalink
Browse files

KNN: give ReferenceSetProxy model attr

  • Loading branch information...
1 parent ae54896 commit 6a13a6633464a7bfb3fca4bb8d28a2cdebe6dde7 @brendonh committed Aug 8, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 warp/crud/colproxy.py
View
@@ -479,12 +479,13 @@ class ReferenceSetProxy(BaseProxy):
Currently supports only one-to-many
"""
- def __init__(self, obj, col, model=None, allowCreate=True)
+ def __init__(self, obj, col, model=None, allowCreate=True):
self.obj = obj
self.col = col
- self.model = model if model else getCrudClass(refClass)
+ self.model = model
self.allowCreate = allowCreate
+
def render_view(self, request):
refset = self.obj.__class__.__dict__[self.col]
@@ -502,7 +503,7 @@ def render_view(self, request):
return renderTemplateObj(request,
template,
- model=model,
+ model=self.model if self.model else getCrudClass(refClass),
presets=presets,
postData=postData,
noEdit=noEdit,

0 comments on commit 6a13a66

Please sign in to comment.