1

Im stuck trying to solve this:

class User(db.Document):
    date_add = db.CreatedField()
    date_update = db.ModifiedField()
    username = db.StringField()
    password = db.StringField()
    active = db.BoolField()
    admin = db.BoolField()
    user_add = db.IntField()
    user_update = db.IntField()

    user_add = db.SRefField(type = User, default = None)
    ser_update = db.SRefField(type = User, default = None)

console says: NameError: name 'User' is not defined, there is some way to handle this?

UPDATE

i ve found the same problem while using the DocumentField class, defining a field like myfield= db.DocumentField(Myclass)inside Myclass create the same error above and cant still figure it out

Vanojx1
  • 5,574
  • 2
  • 23
  • 37

0 Answers0