Get the string value out of fields in MongoEngine?

Viewed 37

How do I get the string value out of fields in MongoEngine? (Totally new to MongoEngine for job.)

class AccessToken(Document):

    application = fields.ReferenceField(oauth2_settings.APPLICATION_MODEL)
    if getattr(application, "client_id", None) is not None:
        print(".  application.client_id: " + application.client_id)

    extras = fields.StringField(blank=True)
    print("   extras: " + str(extras))
class AbstractApplication(Document):
    client_id = fields.StringField(max_length=100, unique=True,
                                 default=generate_client_id, db_index=True)
    print("  client_id: " + str(client_id))

All I'm getting is print output like "object at 0x7fc0eef87a58".

0 Answers
Related