aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/utils/resources.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2019-07-21 10:00:53 +0200
committerGravatar GitHub <[email protected]>2019-07-21 10:00:53 +0200
commit5766439c3b521d9a70f5469ecaa2f4820270ea67 (patch)
treebaaafbd03801af3efc25a1a3fac47bf1ee25a0a3 /pydis_site/utils/resources.py
parentMerge pull request #220 from python-discord/django-api-bot-nomination-changes (diff)
parentUpdate pre-commit config to ignore migrations directory (diff)
Merge pull request #229 from python-discord/low-hanging-merge-fruit
Minor Merges from master
Diffstat (limited to 'pydis_site/utils/resources.py')
-rw-r--r--pydis_site/utils/resources.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pydis_site/utils/resources.py b/pydis_site/utils/resources.py
index ab0df9d7..fcf8bd75 100644
--- a/pydis_site/utils/resources.py
+++ b/pydis_site/utils/resources.py
@@ -10,6 +10,7 @@ import yaml
@dataclass
class URL:
"""A class representing a link to a resource"""
+
icon: str
title: str
url: str
@@ -17,6 +18,7 @@ class URL:
class Resource:
"""A class representing a resource on the resource page"""
+
description: str
name: str
payment: str
@@ -28,7 +30,7 @@ class Resource:
return f"<Resource name={self.name}>"
@classmethod
- def construct_from_yaml(cls, yaml_data: str) -> Resource: # noqa
+ def construct_from_yaml(cls, yaml_data: typing.TextIO) -> Resource: # noqa
resource = cls()
loaded = yaml.safe_load(yaml_data)
@@ -45,6 +47,7 @@ class Resource:
class Category:
"""A class representing a resource on the resources page"""
+
resources: typing.List[Resource]
name: str
description: str