(cls, instance)
| 76 | |
| 77 | @classmethod |
| 78 | def to_model(cls, instance): |
| 79 | user = str(instance.user) if instance.user else None |
| 80 | token = str(instance.token) if instance.token else None |
| 81 | expiry = isotime.parse(instance.expiry) if instance.expiry else None |
| 82 | |
| 83 | model = cls.model(user=user, token=token, expiry=expiry) |
| 84 | return model |
| 85 | |
| 86 | |
| 87 | class ApiKeyAPI(BaseAPI, APIUIDMixin): |