我试图在 Python 中从数据库中检索一些数据。我收到了这个错误:回溯:
Traceback (innermost last):
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 77, in execute_cmd
method = get_attr(cmd)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 98, in get_attr
method = frappe.get_attr(cmd)
File "/home/adminuser/frappe-bench- hitech/apps/frappe/frappe/__init__.py", line 519, in get_attr
return getattr(get_module(modulename), methodname)
AttributeError: 'module' object has no attribute 'generate_barcode'
这是我在做什么:
@frappe.whitelist()
def generate_barcode(self):
brand=self.get("brand_code")
final_barcode="%05d" % random.randint(0,9999)
return {'final_barcode':final_barcode,'brand':brand}
谁能帮我?