diff options
author | 2018-09-21 22:26:52 +0200 | |
---|---|---|
committer | 2018-09-21 22:26:52 +0200 | |
commit | f41aeabe081aeebb198962f9a0b9f8fb52cbf062 (patch) | |
tree | 40983c4c76a4857f76c19233b0661d726d5bd572 /api | |
parent | Add trailing slash to admin page. (diff) |
Add help texts on all API models.
Diffstat (limited to 'api')
-rw-r--r-- | api/migrations/0006_add_help_texts.py | 44 | ||||
-rw-r--r-- | api/models.py | 31 |
2 files changed, 69 insertions, 6 deletions
diff --git a/api/migrations/0006_add_help_texts.py b/api/migrations/0006_add_help_texts.py new file mode 100644 index 00000000..a57d2289 --- /dev/null +++ b/api/migrations/0006_add_help_texts.py @@ -0,0 +1,44 @@ +# Generated by Django 2.1.1 on 2018-09-21 20:26 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0005_user'), + ] + + operations = [ + migrations.AlterField( + model_name='documentationlink', + name='base_url', + field=models.URLField(help_text='The base URL from which documentation will be available for this project. Used to generate links to various symbols within this package.'), + ), + migrations.AlterField( + model_name='documentationlink', + name='inventory_url', + field=models.URLField(help_text='The URL at which the Sphinx inventory is available for this package.'), + ), + migrations.AlterField( + model_name='documentationlink', + name='package', + field=models.CharField(help_text='The Python package name that this documentation link belongs to.', max_length=50, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='offtopicchannelname', + name='name', + field=models.CharField(help_text='The actual channel name that will be used on our Discord server.', max_length=96, primary_key=True, serialize=False, validators=[django.core.validators.RegexValidator(regex='^[a-z0-9-]+$')]), + ), + migrations.AlterField( + model_name='snakename', + name='name', + field=models.CharField(help_text="The regular name for this snake, e.g. 'Python'.", max_length=100, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='snakename', + name='scientific', + field=models.CharField(help_text="The scientific name for this snake, e.g. 'Python bivittatus'.", max_length=150), + ), + ] diff --git a/api/models.py b/api/models.py index 5d7dfc35..f2e47108 100644 --- a/api/models.py +++ b/api/models.py @@ -5,24 +5,43 @@ from django.db import models class DocumentationLink(models.Model): """A documentation link used by the `!docs` command of the bot.""" - package = models.CharField(primary_key=True, max_length=50) - base_url = models.URLField() - inventory_url = models.URLField() + package = models.CharField( + primary_key=True, + max_length=50, + help_text="The Python package name that this documentation link belongs to." + ) + base_url = models.URLField( + help_text=( + "The base URL from which documentation will be available for this project. " + "Used to generate links to various symbols within this package." + ) + ) + inventory_url = models.URLField( + help_text="The URL at which the Sphinx inventory is available for this package." + ) class OffTopicChannelName(models.Model): name = models.CharField( primary_key=True, max_length=96, - validators=(RegexValidator(regex=r'^[a-z0-9-]+$'),) + validators=(RegexValidator(regex=r'^[a-z0-9-]+$'),), + help_text="The actual channel name that will be used on our Discord server." ) class SnakeName(models.Model): """A snake name used by the bot's snake cog.""" - name = models.CharField(primary_key=True, max_length=100) - scientific = models.CharField(max_length=150) + name = models.CharField( + primary_key=True, + max_length=100, + help_text="The regular name for this snake, e.g. 'Python'." + ) + scientific = models.CharField( + max_length=150, + help_text="The scientific name for this snake, e.g. 'Python bivittatus'." + ) class Role(models.Model): |