Removes half-baked field serializers

This commit is contained in:
Mouse Reeve 2020-12-03 13:00:04 -08:00
parent e87236d78f
commit 3a75127301

View file

@ -102,16 +102,6 @@ class ForeignKey(ActivitypubFieldMixin, models.ForeignKey):
return None return None
return value.remote_id return value.remote_id
def field_from_activity(self, value):
if isinstance(value, dict) and value.get('id'):
# if the AP field is a serialized object (as in Add)
remote_id = value['id']
else:
# if the field is just a remote_id (as in every other case)
remote_id = value
return resolve_remote_id(remote_id)
class OneToOneField(ActivitypubFieldMixin, models.OneToOneField): class OneToOneField(ActivitypubFieldMixin, models.OneToOneField):
''' activitypub-aware foreign key field ''' ''' activitypub-aware foreign key field '''
@ -132,12 +122,6 @@ class ManyToManyField(ActivitypubFieldMixin, models.ManyToManyField):
return '%s/followers' % value.instance.remote_id return '%s/followers' % value.instance.remote_id
return [i.remote_id for i in value.all()] return [i.remote_id for i in value.all()]
def field_from_activity(self, valueactivity_data):
if self.link_only:
return None
values = super().field_from_activity(values)
return values# TODO
class TagField(ManyToManyField): class TagField(ManyToManyField):
''' special case of many to many that uses Tags ''' ''' special case of many to many that uses Tags '''