Skip to content
Snippets Groups Projects
Commit 34d456a8 authored by jarmil's avatar jarmil
Browse files

REF: mswebs: prejmenovano pirate_id

parent ce2bc034
No related branches found
No related tags found
2 merge requests!173Release,!134Weby pro MS
# Generated by Django 3.1.1 on 2020-11-04 09:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("shared", "0012_article_date"),
]
operations = [
migrations.RenameField(
model_name="personpage", old_name="pirate_id", new_name="username",
),
]
...@@ -84,7 +84,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page): ...@@ -84,7 +84,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page):
""" """
# ve formatu iapi: https://iapi.pirati.cz/v1/user?username=john.doe # ve formatu iapi: https://iapi.pirati.cz/v1/user?username=john.doe
pirate_id = models.TextField("Pirate ID osoby", blank=False) username = models.TextField("Pirate ID osoby", blank=False)
profile_id = models.IntegerField( profile_id = models.IntegerField(
"Číslo medailonku (0..2) z lide.pirati.cz", "Číslo medailonku (0..2) z lide.pirati.cz",
blank=True, blank=True,
...@@ -95,7 +95,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page): ...@@ -95,7 +95,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page):
perex = models.TextField("Perex osoby", blank=True) perex = models.TextField("Perex osoby", blank=True)
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [
FieldPanel("pirate_id"), FieldPanel("username"),
FieldPanel("profile_id"), FieldPanel("profile_id"),
FieldPanel("perex"), FieldPanel("perex"),
] ]
...@@ -103,7 +103,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page): ...@@ -103,7 +103,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page):
def _iapi(self): def _iapi(self):
""" Vrati data o osobe z piratskeho IAPI jako json. Cached via requests_cache """ """ Vrati data o osobe z piratskeho IAPI jako json. Cached via requests_cache """
return requests.get( return requests.get(
"https://iapi.pirati.cz/v1/user?username=%s" % self.pirate_id "https://iapi.pirati.cz/v1/user?username=%s" % self.username
).json() ).json()
@property @property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment