<s> """<STR_LIT>""" <EOL> __all__ = ( "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> import os <EOL> from gluon import * <EOL> from gluon . storage import Storage <EOL> from . . s3 import * <EOL> class OCRDataModel ( S3Model ) : <EOL> """<STR_LIT:U+0020>""" <EOL> names = ( "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> def model ( self ) : <EOL> define_table = self . define_table <EOL> folder = current . request . folder <EOL> metadata_folder = os . path . join ( folder , "<STR_LIT>" , "<STR_LIT>" ) <EOL> payload_folder = os . path . join ( folder , "<STR_LIT>" , "<STR_LIT>" ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True , <EOL> length = <NUM_LIT> , <EOL> unique = True ) , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> length = current . MAX_FILENAME_LENGTH , <EOL> uploadfolder = metadata_folder , <EOL> ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> length = current . MAX_FILENAME_LENGTH , <EOL> uploadfolder = metadata_folder , <EOL> ) , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True , <EOL> length = <NUM_LIT> , <EOL> unique = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> * s3_meta_fields ( ) ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> length = current . MAX_FILENAME_LENGTH , <EOL> notnull = True , <EOL> uploadfolder = payload_folder , <EOL> ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> notnull = True ) , <EOL> * s3_meta_fields ( ) ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True , <EOL> length = <NUM_LIT> , <EOL> unique = True ) , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> notnull = True , <EOL> default = <NUM_LIT:0> ) , <EOL> Field ( "<STR_LIT>" , <EOL> length = <NUM_LIT> , <EOL> unique = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> * s3_meta_fields ( ) ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> length = current . MAX_FILENAME_LENGTH , <EOL> notnull = True , <EOL> uploadfolder = payload_folder , <EOL> ) , <EOL> Field ( "<STR_LIT:value>" ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> * s3_meta_fields ( ) ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT>" , <EOL> length = <NUM_LIT> , <EOL> unique = True , <EOL> notnull = True ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> length = current . MAX_FILENAME_LENGTH , <EOL> notnull = True , <EOL> uploadfolder = payload_folder , <EOL> ) , <EOL> Field ( "<STR_LIT>" , <EOL> notnull = True , <EOL> default = "<STR_LIT>" ) , <EOL> * s3_meta_fields ( ) ) <EOL> def ocr_buttons ( r ) : <EOL> """<STR_LIT>""" <EOL> if not current . deployment_settings . has_module ( "<STR_LIT>" ) : <EOL> return "<STR_LIT>" <EOL> if r . component : <EOL> urlargs = [ r . id , r . component_name ] <EOL> else : <EOL> urlargs = [ ] <EOL> f = r . function <EOL> c = r . controller <EOL> a = r . application <EOL> T = current . T <EOL> UPLOAD = T ( "<STR_LIT>" ) <EOL> DOWNLOAD = T ( "<STR_LIT>" ) <EOL> _style = "<STR_LIT>" <EOL> output = DIV ( <EOL> A ( IMG ( _src = "<STR_LIT>" % a , _alt = UPLOAD ) , <EOL> _id = "<STR_LIT>" , <EOL> _href = URL ( c = c , f = f , args = urlargs + [ "<STR_LIT>" ] ) , <EOL> _title = UPLOAD , <EOL> _style = _style ) , <EOL> A ( IMG ( _src = "<STR_LIT>" % a , _alt = DOWNLOAD ) , <EOL> _id = "<STR_LIT>" , <EOL> _href = URL ( c = c , f = f , args = urlargs + [ "<STR_LIT>" ] ) , <EOL> _title = DOWNLOAD , <EOL> _style = _style ) , <EOL> ) <EOL> return output </s>
