Skip to content
Browse files

KNN: optional configModule

  • Loading branch information...
1 parent 6a13a66 commit bc0e8aaa37e03ed1d4683d4971f0c78b14c5b4fd @khangnguyen khangnguyen committed with
Showing with 8 additions and 8 deletions.
  1. +4 −2 twisted/plugins/warp_plugin.py
  2. +4 −6 warp/crud/colproxy.py
View
6 twisted/plugins/warp_plugin.py
@@ -18,6 +18,7 @@
class SkeletonOptions(usage.Options):
optParameters = (
("siteDir", "d", ".", "Base directory of the warp site"),
+ ("config", "c", "warpconfig", "Default config module")
)
class NodeOptions(usage.Options):
@@ -37,6 +38,7 @@ def parseArgs(self, fqn):
class Options(usage.Options):
optParameters = (
("siteDir", "d", ".", "Base directory of the warp site"),
+ ("config", "c", "warpconfig", "Default config module")
)
subCommands = (
@@ -66,8 +68,8 @@ def makeService(self, options):
from warp.tools import skeleton
skeleton.createSkeleton(siteDir)
raise SystemExit
-
- configModule = __import__('warpconfig')
+
+ configModule = reflect.namedModule(options['config'])
config = configModule.config
runtime.config.update(config)
runtime.config['siteDir'] = siteDir
View
10 warp/crud/colproxy.py
@@ -418,6 +418,8 @@ def render_edit(self, request):
refClass = reference._relation.remote_cls
crudClass = getCrudClass(refClass)
+ print "xxxx ", noEdit
+
if self.col in noEdit or idCol in noEdit:
obj = request.store.get(refClass, objID)
return '<input type="hidden" name="warpform-%s" value="%s" />%s' % (
@@ -479,11 +481,7 @@ class ReferenceSetProxy(BaseProxy):
Currently supports only one-to-many
"""
- def __init__(self, obj, col, model=None, allowCreate=True):
- self.obj = obj
- self.col = col
- self.model = model
- self.allowCreate = allowCreate
+ allowCreate = True
def render_view(self, request):
@@ -503,7 +501,7 @@ def render_view(self, request):
return renderTemplateObj(request,
template,
- model=self.model if self.model else getCrudClass(refClass),
+ model=getCrudClass(refClass),
presets=presets,
postData=postData,
noEdit=noEdit,

0 comments on commit bc0e8aa

Please sign in to comment.
Something went wrong with that request. Please try again.