问题
Trying to optimise db model class property name by using name
in the property.
Ex.
class terminals(db.Model):
location_code = db.StringProperty()
terminal_code = db.StringProperty(default='')
start_invoice_no = db.IntegerProperty(indexed=False, default=1, name='sin')
next_invoice_no = db.IntegerProperty(indexed=False)
last_doc_details = db.TextProperty(default='{}')
Query on terminals:
terminal_qry = db.Model(terminals).all()
putting happening fine into db. but while i try serialize this query object.
serializers.serialize('json', [terminal_qry])
its raising the error as,
AttributeError: 'terminals' object has no attribute 'sin'
Could any one tell this, where went wrong here?
Regards.
来源:https://stackoverflow.com/questions/12870637/gae-db-model-property-using-name-param