how to represent postgresql json field in ninja schema?

65 views
Skip to first unread message

Krishnakant Mane

unread,
Aug 17, 2024, 6:04:30 AM8/17/24
to django...@googlegroups.com

Helo.

I guess the question is obvious.

I have json field in my postgresql table and django orm has no issues with it.

But I am not able to find out oa way to use it in my schema in ninja.

class orgin(Schema):
orgname: str
orgaddr: str
orgdetails: json
This does not work.
Any hint?
Regards.

Pandiya rajan

unread,
Aug 18, 2024, 10:30:04 AM8/18/24
to django...@googlegroups.com
from ninja import Schema
from typing import Dict, Any

class Origin(Schema):
    orgname: str
    orgaddr: str
    orgdetails: Dict[str, Any]     can you try this

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f7a1f6a0-af73-4c6a-b5cb-50d2e08baf1a%40gmail.com.
Reply all
Reply to author
Forward
0 new messages