<commit_before>from rest_framework import serializers as ser
from rest_framework import exceptions

from api.base.utils import absolute_reverse
from api.nodes.serializers import NodeSerializer
from api.base.serializers import IDField, JSONAPIHyperlinkedIdentityField, LinksField


class RegistrationSerializer(NodeSerializer):

    retracted = ser.BooleanField(source='is_retracted', read_only=True,
        help_text='Whether this registration has been retracted.')
    pending_registration = ser.CharField(read_only=True, source='registration_approval')
    date_registered = ser.DateTimeField(source='registered_date', read_only=True, help_text='Date time of registration.')
    embargoed = ser.BooleanField(read_only=True, source='embargo.state')
    embargo_end_date = ser.DateTimeField(source='embargo.end_date', read_only=True)
    registration_schema = ser.CharField(read_only=True)
    registered_meta = ser.CharField(read_only=True)


    registered_by = JSONAPIHyperlinkedIdentityField(
        view_name='users:user-detail',
        lookup_field='registered_user_id',
        link_type='related',
        lookup_url_kwarg='user_id'
    )

    registered_from = JSONAPIHyperlinkedIdentityField(
        view_name='nodes:node-detail',<commit_msg>Make field match field on db<commit_after>from rest_framework import serializers as ser
from rest_framework import exceptions

from api.base.utils import absolute_reverse
from api.nodes.serializers import NodeSerializer
from api.base.serializers import IDField, JSONAPIHyperlinkedIdentityField, LinksField


class RegistrationSerializer(NodeSerializer):

    retracted = ser.BooleanField(source='is_retracted', read_only=True,
        help_text='Whether this registration has been retracted.')
    pending_registration = ser.CharField(read_only=True, source='registration_approval')
    date_registered = ser.DateTimeField(source='registered_date', read_only=True, help_text='Date time of registration.')
    embargoed = ser.BooleanField(read_only=True, source='embargo.state')
    embargo_end_date = ser.DateTimeField(source='embargo.end_date', read_only=True)
    registration_schema = ser.CharField(read_only=True, source='registered_schema')
    registered_meta = ser.CharField(read_only=True)


    registered_by = JSONAPIHyperlinkedIdentityField(
        view_name='users:user-detail',
        lookup_field='registered_user_id',
        link_type='related',
        lookup_url_kwarg='user_id'
    )

    registered_from = JSONAPIHyperlinkedIdentityField(
        view_name='nodes:node-detail',
{'fraction_non_alphanumeric': 0.08688845401174168, 'fraction_numerical': 0.0, 'mean_word_length': 5.708661417322834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1762112', 'n_tokens_mistral': 737, 'n_tokens_neox': 701, 'n_words': 133}