hi,

i'm trying to move the ckeditor function from models/db.py into 
modules/advanced_editor.py but it return an error.

Traceback (most recent call last):
  File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 217, in 
restricted
  File 
"C:/Users/sugizo/Desktop/web2py/2.8.2/applications/stifix/models/db_wizard_2_auth.py"
 <http://127.0.0.1:8000/admin/default/edit/stifix/models/db_wizard_2_auth.py>, 
line 38, in <module>
    requires = IS_IN_DB(db, db.branch.id, '%(address)s') )
  File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8244, in 
__getattr__
  File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8160, in 
lazy_define_table
  File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8765, in 
_create_references
  File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8238, in 
__getitem__
  File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8244, in 
__getattr__
  File "/home/mdipierro/make_web2py/web2py/gluon/dal.py", line 8182, in 
lazy_define_table
  File 
"C:/Users/sugizo/Desktop/web2py/2.8.2/applications/stifix/models/db_wizard_0_company.py"
 
<http://127.0.0.1:8000/admin/default/edit/stifix/models/db_wizard_0_company.py>,
 line 48, in on_define_company
    table.home.widget = advanced_editor
NameError: global name 'advanced_editor' is not defined


here is the code in modules/advanced_editor.py
#!/usr/bin/env python
# coding: utf8
from gluon import *

# advanced_editor using ckeditor
def advanced_editor(field, value):
return TEXTAREA(_id = str(field).replace('.','_'), _name = field.name, 
_class = 'text ckeditor', value = value, _cols = 80, _rows = 10)

if tried to add the current.field and current.value in the 
modules/advanced_editor.py it'll return an error :

Traceback (most recent call last):
  File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 217, in 
restricted
  File 
"C:/Users/sugizo/Desktop/web2py/2.8.2/applications/stifix/models/db_wizard_0_company.py"
 
<http://127.0.0.1:8000/admin/default/edit/stifix/models/db_wizard_0_company.py>,
 line 4, in <module>
    import stifix_advanced_editor
  File "/home/mdipierro/make_web2py/web2py/gluon/custom_import.py", line 94, in 
custom_importer
  File "applications\stifix\modules\stifix_advanced_editor.py", line 6
    def advanced_editor(current.field, current.value):
                               ^
SyntaxError: invalid syntax


what is the best way to import module for ckeditor in models?

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to