Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions api/migrations/0003_delete_manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.2.9 on 2026-02-13 11:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0002_document_v2_related_key'),
]

operations = [
migrations.DeleteModel(
name='Manifest',
),
]
1 change: 0 additions & 1 deletion api/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
The initialization for models for open5e's api.
"""
from .models import Manifest
from .models import Document
from .models import GameContent
from .models import CharClass
Expand Down
28 changes: 0 additions & 28 deletions api/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,6 @@
from django.template.defaultfilters import slugify
#from api_v2 import urls as urls_v2

class Manifest(models.Model):
"""A Manifest contains a hash based on the contents of a file.

This is intended for folks who process and store content from our API.
When they download content, they also download the corresponding manifest.
Periodically, they check back in to see whether any manifests have changed.
If so, then they know to re-download that source.
"""

filename = models.CharField(
max_length=255,
unique=True,
help_text='Input file name.')
type = models.CharField(
max_length=25,
help_text='Type of file (maps to a model).')
hash = models.CharField(max_length=255,
help_text='md5 hash of the file contents.')
created_at = models.DateTimeField(
auto_now_add=True,
help_text='Date that this object was added to the database.')

@staticmethod
def plural_str() -> str:
"""Return a string specifying the plural name of this model."""
return "Manifests"


class Document(models.Model):
slug = models.CharField(max_length=255, unique=True, default=uuid.uuid1)
# System Reference Document
Expand Down
6 changes: 0 additions & 6 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
from api import models
from api import search_indexes


class ManifestSerializer(serializers.ModelSerializer):
class Meta:
model = models.Manifest
fields = ('filename', 'type', 'hash', 'created_at')

class DynamicFieldsModelSerializer(serializers.ModelSerializer):

def __init__(self, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"documents": "http://localhost:8000/v2/documents/",
"feats": "http://localhost:8000/v2/feats/",
"magicitems": "http://localhost:8000/v1/magicitems/",
"manifest": "http://localhost:8000/v1/manifest/",
"monsters": "http://localhost:8000/v1/monsters/",
"planes": "http://localhost:8000/v1/planes/",
"races": "http://localhost:8000/v1/races/",
Expand Down
2 changes: 0 additions & 2 deletions api/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def test_feats(self):
def test_magicitems(self):
self._verify("/magicitems")

# /manifest is excluded because it's too volatile

def test_monsters(self):
pass
# This test is flaky, and fails on one machine, but passes on another.
Expand Down
2 changes: 0 additions & 2 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from server.routers import DocumentedDefaultRouter

router = DocumentedDefaultRouter()
router.register(r'manifest', views.ManifestViewSet)
router.register(r'spells', views.SpellViewSet)
router.register(r'spelllist',views.SpellListViewSet)
router.register(r'monsters', views.MonsterViewSet)
Expand All @@ -24,6 +23,5 @@

urlpatterns = [
path('', include(router.urls)), #Consider removing this after a while.
path('version/', views.get_version, name="version"),
path('v1/', include(router.urls))
]
24 changes: 0 additions & 24 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,6 @@
from api import serializers
from api import filters



class ManifestViewSet(viewsets.ReadOnlyModelViewSet):
"""
list: API endpoint for returning a list of of manifests.

For each data source file, there is a corresponding manifest containing an
MD5 hash of the data inside that file. When we update our data files, the
corresponding manifest's hash changes. If you host a service that
automatically downloads data from Open5e, you can periodically check
the manifests to determine whether your data is out of date.

retrieve: API endpoint for returning a particular manifest.

For each data source file, there is a corresponding manifest containing an
MD5 hash of the data inside that file. When we update our data files, the
corresponding manifest's hash changes. If you host a service that
automatically downloads data from Open5e, you can periodically check
the manifests to determine whether your data is out of date.
"""
queryset = models.Manifest.objects.all().order_by("pk")
serializer_class = serializers.ManifestSerializer


@api_view()
def get_version(_):
"""
Expand Down
8 changes: 0 additions & 8 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ erDiagram
TEXT copyright
}

api_manifest {
INTEGER id
VARCHAR filename
VARCHAR type
VARCHAR hash
DATETIME created_at
}

auth_group {
INTEGER id
VARCHAR name
Expand Down
28 changes: 0 additions & 28 deletions server/version.py

This file was deleted.