diff options
author | 2023-03-29 00:58:27 +0200 | |
---|---|---|
committer | 2023-03-29 20:15:50 +0200 | |
commit | 621280892b96875beb5053cbd07a837f1833310a (patch) | |
tree | f2371b7174082baac0b8d07abe1b295abc2fca51 /pydis_site/apps/home/models.py | |
parent | Merge pull request #920 from python-discord/dependabot/pip/django-filter-23.1 (diff) |
Add a readme for the home app
This commit also moves the nested structures for models and views in the
home app into a single module, as they were not split up as part of the
subpackage, with the goal of making this a bit more overseeable.
Part of #674.
Diffstat (limited to 'pydis_site/apps/home/models.py')
-rw-r--r-- | pydis_site/apps/home/models.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pydis_site/apps/home/models.py b/pydis_site/apps/home/models.py new file mode 100644 index 00000000..00a83cd7 --- /dev/null +++ b/pydis_site/apps/home/models.py @@ -0,0 +1,33 @@ +from django.db import models + + +class RepositoryMetadata(models.Model): + """Information about one of our repos fetched from the GitHub API.""" + + last_updated = models.DateTimeField( + help_text="The date and time this data was last fetched.", + auto_now=True, + ) + repo_name = models.CharField( + primary_key=True, + max_length=40, + help_text="The full name of the repo, e.g. python-discord/site", + ) + description = models.CharField( + max_length=400, + help_text="The description of the repo.", + ) + forks = models.IntegerField( + help_text="The number of forks of this repo", + ) + stargazers = models.IntegerField( + help_text="The number of stargazers for this repo", + ) + language = models.CharField( + max_length=20, + help_text="The primary programming language used for this repo.", + ) + + def __str__(self): + """Returns the repo name, for display purposes.""" + return self.repo_name |