Skip to content

Commit cfdf762

Browse files
Merge pull request #624 from calumbell/refac/598-rmv-stats_expected-from-docs
Remove `'expected_stats`' from Document
2 parents ca4fcb1 + 83264b4 commit cfdf762

File tree

23 files changed

+17
-31
lines changed

23 files changed

+17
-31
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 5.1.2 on 2025-02-25 10:50
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('api_v2', '0020_remove_classfeatureitem_column_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='document',
15+
name='stats_expected',
16+
),
17+
]

api_v2/models/document.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ class Document(HasName, HasDescription):
3838
help_text="Link to the document."
3939
)
4040

41-
stats_expected = models.JSONField(
42-
null=True,
43-
blank=True,
44-
help_text="JSON representation of expected object counts."
45-
)
46-
4741
distance_unit = distance_unit_field()
4842

4943
@property
@@ -78,10 +72,6 @@ def stats(self):
7872
stat = {}
7973
stat['name'] = model.__name__.lower()
8074
stat['actual_count'] = actual_object_count
81-
try:
82-
stat['expected_count'] = self.stats_expected.get(model.__name__.lower())
83-
except:
84-
stat['expected_count'] = None
8575
stats.append(stat)
8676

8777
return stats

api_v2/tests/responses/TestObjects.test_document_example.approved.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@
2222
"permalink": "https://dnd.wizards.com/resources/systems-reference-document",
2323
"published_at": "2023-01-23T00:00:00",
2424
"publisher": "http://localhost:8000/v2/publishers/wizards-of-the-coast/",
25-
"stats_expected": null,
2625
"url": "http://localhost:8000/v2/documents/srd/"
2726
}

data/v2/en-publishing/a5e-ag/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "EN Publishing",
1111
"published_at": "2021-11-01T00:00:00",
1212
"permalink": "https://a5esrd.com/a5esrd",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"cc-by-40",

data/v2/en-publishing/a5e-ddg/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "EN Publishing",
1111
"published_at": "2023-10-03T00:00:00",
1212
"permalink": "https://a5esrd.com/a5esrd",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"cc-by-40",

data/v2/en-publishing/a5e-gpg/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "EN Publishing",
1111
"published_at": "2022-01-01T00:00:00",
1212
"permalink": "https://a5esrd.com/a5esrd",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"cc-by-40",

data/v2/en-publishing/mmenag/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "Paul Hughes",
1111
"published_at": "2021-12-12T00:00:00",
1212
"permalink": "https://enpublishingrpg.com/collections/level-up-advanced-5th-edition-a5e/products/level-up-monstrous-menagerie-a5e",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"ogl-10a"

data/v2/green-ronin/tdcs/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "Matthew Mercer, James Haeck",
1111
"published_at": "2017-08-17T00:00:00",
1212
"permalink": "https://en.wikipedia.org/wiki/Critical_Role%3A_Tal'Dorei_Campaign_Setting",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"ogl-10a"

data/v2/kobold-press/bfrd/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "Open Design LLC d/b/a Kobold Press",
1111
"published_at": "2023-10-16T00:00:00",
1212
"permalink": "https://koboldpress.com/black-flag-reference-document/",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"cc-by-40"

data/v2/kobold-press/ccdx/Document.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "Wolfgang Baur, Dan Dillon, Richard Green, James Haeck, Chris Harris, Jeremy Hochhalter, James Introcaso, Chris Lockey, Shawn Merwin, and Jon Sawatsky",
1111
"published_at": "2018-06-01T00:00:00",
1212
"permalink": "https://koboldpress.com/kpstore/product/creature-codex-for-5th-edition-dnd/",
13-
"stats_expected": null,
1413
"distance_unit": "feet",
1514
"licenses": [
1615
"ogl-10a"

0 commit comments

Comments
 (0)