settings.py
from pyorient.ogm import declarative
Node = declarative.declarative_node()
Relationship = declarative.declarative_relationship()
models/user.py
from pyorient.ogm.property import *
from my_proj.settings import Node
class User(Node):
email = String(unique=True)
password = String()
serializers/register_serializer.py
from rest_framework import serializers, validators
from users.models.user import User
class RegisterSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('email', 'password')
I get the following exception
AttributeError: type object 'User' has no attribute '_meta
Add property to your model as,
Then use
serializers.Serializer
instead ofserializers.ModelSerializer
as,Then, you will get serialized data as,