Flask-RESTful Documentation Release 0.3.6
when working with objects. To solve this problem, Flask- RESTful provides the fields module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from collections import OrderedDict from flask_restful import fields, marshal_with resource_fields = { 'task': fields.String, 'uri': fields.Url('todo_ep') } 6 Chapter 1. User’s task # This field will not be sent in the response self.status = 'active' class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember0 码力 | 46 页 | 245.60 KB | 1 年前3Flask-RESTful Documentation Release 0.3.6
when working with objects. To solve this problem, Flask-RESTful provides the fields module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from collections import OrderedDict from flask_restful import fields, marshal_with resource_fields = { 'task': fields.String, 'uri': fields.Url('todo_ep') } class field will not be sent in the response self.status = 'active' class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember0 码力 | 49 页 | 91.90 KB | 1 年前3Flask-RESTful Documentation Release 0.3.7
module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from flask_restful import fields, marshal_with resource_fields Flask-RESTful Documentation, Release 0.3.7 (continued from previous page) class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember task='Remember the milk') The above example takes a python object and prepares it to be serialized. The marshal_with() decorator will apply the transformation described by resource_fields. The only field extracted0 码力 | 50 页 | 253.09 KB | 1 年前3Flask-RESTful Documentation Release 0.3.8
module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from flask_restful import fields, marshal_with resource_fields Flask-RESTful Documentation, Release 0.3.8 (continued from previous page) class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember task='Remember the milk') The above example takes a python object and prepares it to be serialized. The marshal_with() decorator will apply the transformation described by resource_fields. The only field extracted0 码力 | 50 页 | 253.64 KB | 1 年前3Flask-RESTful Documentation Release 0.3.8
module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from flask_restful import fields, marshal_with resource_fields field will not be sent in the response self.status = 'active' class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember task='Remember the milk') The above example takes a python object and prepares it to be serialized. The marshal_with() decorator will apply the transformation described by resource_fields. The only field extracted0 码力 | 55 页 | 93.30 KB | 1 年前3Flask-RESTful Documentation Release 0.3.7
module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from flask_restful import fields, marshal_with resource_fields field will not be sent in the response self.status = 'active' class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember task='Remember the milk') The above example takes a python object and prepares it to be serialized. The marshal_with() decorator will apply the transformation described by resource_fields. The only field extracted0 码力 | 55 页 | 93.21 KB | 1 年前3Flask-RESTful Documentation Release 0.3.10
module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from flask_restful import fields, marshal_with resource_fields field will not be sent in the response self.status = 'active' class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember task='Remember the milk') The above example takes a python object and prepares it to be serialized. The marshal_with() decorator will apply the transformation described by resource_fields. The only field extracted0 码力 | 42 页 | 84.60 KB | 1 年前3Flask-RESTful Documentation Release 0.3.10
module and the marshal_with() decorator. Similar to the Django ORM and WTForm, you use the fields module to describe the structure of your response. from flask_restful import fields, marshal_with resource_fields Flask-RESTful Documentation, Release 0.3.10 (continued from previous page) class Todo(Resource): @marshal_with(resource_fields) def get(self, **kwargs): return TodoDao(todo_id='my_todo', task='Remember task='Remember the milk') The above example takes a python object and prepares it to be serialized. The marshal_with() decorator will apply the transformation described by resource_fields. The only field extracted0 码力 | 39 页 | 212.29 KB | 1 年前3PyArmor Documentation v5.3.0
name ‘__pyarmor__’ is not defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 12.5 Marshal loads failed when running xxx.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 reformed code object and obfuscate it to protect constants and literal strings: char *string_code = marshal.dumps( co ); char *obfuscated_code = obfuscate_algorithm( string_code ); Finally generate obfuscated *obfuscated_code) { char *string_code = restore_obfuscated_code( obfuscated_code ); PyCodeObject *co = marshal.loads( string_code ); return PyImport_ExecCodeModuleEx( name, co, pathname ); } After that, in the0 码力 | 85 页 | 299.37 KB | 1 年前3PyArmor Documentation v5.6.5
_pytransform The license.lic generated doesn’t work NameError: name ‘__pyarmor__’ is not defined Marshal loads failed when running xxx.py _pytransform can not be loaded twice Check restrict mode failed filename, Py_file_input ); obfuscate_each_function_in_module( co, obf_mode ); char *original_code = marshal.dumps( co ); char *obfuscated_code = obfuscate_algorithm( original_code ); sprintf( buffer, "__pyarmor__(__name__ reformed code object and obfuscate it to protect constants and literal strings: char *string_code = marshal.dumps( co ); char *obfuscated_code = obfuscate_algorithm( string_code ); Finally generate obfuscated0 码力 | 103 页 | 86.97 KB | 1 年前3
共 97 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10