Skip to content

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

@alexeydad1

Description

@alexeydad1

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

result[x] = row[x].isoformat()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions