2022-08-19 10:35:05 +00:00
|
|
|
from rest_framework import serializers
|
|
|
|
|
2022-08-20 03:33:23 +00:00
|
|
|
from frog_api.models import Entry, Project, Version
|
2022-08-19 10:35:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectSerializer(serializers.HyperlinkedModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = Project
|
|
|
|
fields = ["slug", "name"]
|
|
|
|
|
|
|
|
|
|
|
|
class VersionSerializer(serializers.HyperlinkedModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = Version
|
|
|
|
fields = ["project", "slug", "name"]
|
|
|
|
|
|
|
|
|
|
|
|
class EntrySerializer(serializers.HyperlinkedModelSerializer):
|
|
|
|
class Meta:
|
2022-08-20 03:33:23 +00:00
|
|
|
model = Entry
|
2022-08-19 10:35:05 +00:00
|
|
|
fields = [
|
|
|
|
"timestamp",
|
|
|
|
"git_hash",
|
2022-08-20 03:33:23 +00:00
|
|
|
"total_chunks",
|
|
|
|
"decompiled_chunks",
|
|
|
|
"matching_chunks",
|
2022-08-19 10:35:05 +00:00
|
|
|
"total_bytes",
|
|
|
|
"decompiled_bytes",
|
|
|
|
"matching_bytes",
|
|
|
|
]
|