Permalink
Browse files

Add override index for the crud command

Example:
play crud:override --index
  • Loading branch information...
1 parent 2abc166 commit bdb219136af356a347c6cf86ac8e14a7c667185b @jimmyy jimmyy committed with erwan Apr 18, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 modules/crud/commands.py
@@ -16,7 +16,7 @@ def execute(**kargs):
play_env = kargs.get("env")
try:
- optlist, args = getopt.getopt(remaining_args, 't:', ['css','layout','template='])
+ optlist, args = getopt.getopt(remaining_args, 't:', ['css','index','layout','template='])
for o, a in optlist:
if o in ('-t', '--template'):
c = a.split('/')[0]
@@ -30,6 +30,11 @@ def execute(**kargs):
print "~ "
return
+ if o == '--index':
+ app.override('app/views/CRUD/index.html', 'app/views/CRUD/index.html')
+ print "~ "
+ return
+
if o == '--css':
app.override('public/stylesheets/crud.css', 'public/stylesheets/crud.css')
print "~ "
@@ -42,6 +47,7 @@ def execute(**kargs):
print "~ Specify the template to override, ex : -t Users/list"
print "~ "
- print "~ Use --css to override the CRUD css"
+ print "~ Use --css to override the CRUD css"
+ print "~ Use --index to override the CRUD index"
print "~ Use --layout to override the CRUD layout"
- print "~ "
+ print "~ "

0 comments on commit bdb2191

Please sign in to comment.