xnuinside / gino-admin

Admin Panel for GinoORM - ready to up & run (just add your models)
https://gino-admin.readthedocs.io/en/latest/
MIT License
49 stars 10 forks source link

AttributeError: 'NoneType' object has no attribute 'isoformat' #43

Open alexeydad1 opened 3 years ago

alexeydad1 commented 3 years ago

I got this error when I tried to open the model in the admin panel File "..../venv/lib/python3.8/site-packages/gino_admin/utils.py", line 304, in get_obj_id_from_row result[x] = row[x].isoformat() AttributeError: 'NoneType' object has no attribute 'isoformat'

model

class Notification(db.Model): ...... created_at = db.Column( sa.DateTime, nullable=False, server_default=sa.func.now(), )

read_at = db.Column(sa.DateTime, nullable=True)

The error occurs for the read_at field, since it can be None

https://github.com/xnuinside/gino-admin/blob/1789d63c66e808a17b1cd4c96537ba6e64d227db/gino_admin/utils.py#L304

xnuinside commented 3 years ago

@alexeydad1, hi thanks for opening the issue, but I'm not sure when I can fix it, library in low priority for me right now, but if you want - you can open the PR and I will merge it