Skip to content

Commit

Permalink
Inheritance from DFHMS for classes that previously
Browse files Browse the repository at this point in the history
inherited from both DFMS and HMS, as well as classes that only
inherited from HMS, in order to provide dynamic field serialization
on those classes.
Subrace is left out due to a bug in the DFHMS, which will be fixed in the following commit.
  • Loading branch information
Gresh committed Aug 5, 2023
1 parent c64a8d0 commit fd63e13
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')

class DocumentSerializer(serializers.HyperlinkedModelSerializer):
class DocumentSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Document
fields = (
Expand All @@ -62,7 +62,7 @@ class Meta:
model = Group
fields = ('url', 'name')

class MonsterSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer, serializers.ModelSerializer):
class MonsterSerializer(DynamicFieldsHyperlinkedModelSerializer):

speed = serializers.SerializerMethodField()
environments = serializers.SerializerMethodField()
Expand Down Expand Up @@ -215,7 +215,7 @@ class Meta:
'document__url'
)

class BackgroundSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class BackgroundSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Background
fields = (
Expand All @@ -235,12 +235,12 @@ class Meta:
'document__url'
)

class PlaneSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class PlaneSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Plane
fields = ('slug','name','desc','document__slug', 'document__title', 'document__url')

class SectionSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class SectionSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Section
fields = (
Expand All @@ -254,7 +254,7 @@ class Meta:
'parent'
)

class FeatSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class FeatSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Feat
fields = (
Expand All @@ -268,7 +268,7 @@ class Meta:
'document__url'
)

class ConditionSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class ConditionSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Condition
fields = (
Expand All @@ -280,7 +280,7 @@ class Meta:
'document__url'
)

class SubraceSerializer(serializers.HyperlinkedModelSerializer):
class SubraceSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Subrace
fields = ('name',
Expand All @@ -294,7 +294,7 @@ class Meta:
'document__url'
)

class RaceSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class RaceSerializer(DynamicFieldsHyperlinkedModelSerializer):
subraces = SubraceSerializer(many=True,read_only=True)
class Meta:
model = models.Race
Expand Down Expand Up @@ -333,7 +333,7 @@ class Meta:
'document__url'
)

class CharClassSerializer(serializers.HyperlinkedModelSerializer):
class CharClassSerializer(DynamicFieldsHyperlinkedModelSerializer):
archetypes = ArchetypeSerializer(many=True,read_only=True)
class Meta:
model = models.CharClass
Expand All @@ -360,7 +360,7 @@ class Meta:
'document__url'
)

class MagicItemSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedModelSerializer):
class MagicItemSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.MagicItem
fields = (
Expand All @@ -375,7 +375,7 @@ class Meta:
'document__url'
)

class WeaponSerializer(serializers.HyperlinkedModelSerializer):
class WeaponSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Weapon
fields = (
Expand All @@ -392,7 +392,7 @@ class Meta:
'weight',
'properties')

class ArmorSerializer(serializers.HyperlinkedModelSerializer):
class ArmorSerializer(DynamicFieldsHyperlinkedModelSerializer):
class Meta:
model = models.Armor
fields = (
Expand Down

0 comments on commit fd63e13

Please sign in to comment.