picata 0.0.10__py3-none-any.whl → 0.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- manage.py +4 -0
- picata/migrations/0001_initial.py +5 -5
- picata/models.py +16 -4
- {picata-0.0.10.dist-info → picata-0.0.11.dist-info}/METADATA +1 -1
- {picata-0.0.10.dist-info → picata-0.0.11.dist-info}/RECORD +7 -7
- {picata-0.0.10.dist-info → picata-0.0.11.dist-info}/WHEEL +0 -0
- {picata-0.0.10.dist-info → picata-0.0.11.dist-info}/licenses/LICENSE.md +0 -0
manage.py
CHANGED
@@ -2,9 +2,13 @@
|
|
2
2
|
"""Entry-point for Django management commands."""
|
3
3
|
|
4
4
|
from os import environ
|
5
|
+
from pathlib import Path
|
5
6
|
from sys import argv
|
6
7
|
|
7
8
|
if __name__ == "__main__":
|
9
|
+
log_dir = Path(__file__).resolve().parent.parent / "logs"
|
10
|
+
Path.mkdir(log_dir, exist_ok=True)
|
11
|
+
|
8
12
|
environ.setdefault("DJANGO_SETTINGS_MODULE", "picata.settings.dev")
|
9
13
|
|
10
14
|
if len(argv) >= 2: # noqa: PLR2004
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Generated by Django 5.1.5 on 2025-01
|
1
|
+
# Generated by Django 5.1.5 on 2025-02-01 01:16
|
2
2
|
|
3
3
|
import django.db.models.deletion
|
4
4
|
import modelcluster.contrib.taggit
|
@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
|
|
32
32
|
name='BasicPage',
|
33
33
|
fields=[
|
34
34
|
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
|
35
|
-
('content', wagtail.fields.StreamField([('rich_text', 0), ('code', 3), ('image', 4)], blank=True, block_lookup={0: ('wagtail.blocks.RichTextBlock', (), {}), 1: ('wagtail.blocks.TextBlock', (), {'help_text': None, 'required': True}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('
|
35
|
+
('content', wagtail.fields.StreamField([('rich_text', 0), ('code', 3), ('image', 4)], blank=True, block_lookup={0: ('wagtail.blocks.RichTextBlock', (), {}), 1: ('wagtail.blocks.TextBlock', (), {'help_text': None, 'required': True}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('plaintext', 'Plain Text'), ('bash', 'Bash'), ('css', 'CSS'), ('javascript', 'JavaScript'), ('html', 'HTML'), ('python', 'Python'), ('toml', 'TOML'), ('yaml', 'YAML')], 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('code', 1), ('language', 2)]], {}), 4: ('wagtail.images.blocks.ImageChooserBlock', (), {})}, help_text='Main content for the page.')),
|
36
36
|
],
|
37
37
|
options={
|
38
38
|
'abstract': False,
|
@@ -78,7 +78,7 @@ class Migration(migrations.Migration):
|
|
78
78
|
name='SplitViewPage',
|
79
79
|
fields=[
|
80
80
|
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
|
81
|
-
('content', wagtail.fields.StreamField([('rich_text', 0), ('code', 3), ('image', 4), ('icon_link_lists', 14)], blank=True, block_lookup={0: ('wagtail.blocks.RichTextBlock', (), {}), 1: ('wagtail.blocks.TextBlock', (), {'help_text': None, 'required': True}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('
|
81
|
+
('content', wagtail.fields.StreamField([('rich_text', 0), ('code', 3), ('image', 4), ('icon_link_lists', 14)], blank=True, block_lookup={0: ('wagtail.blocks.RichTextBlock', (), {}), 1: ('wagtail.blocks.TextBlock', (), {'help_text': None, 'required': True}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('plaintext', 'Plain Text'), ('bash', 'Bash'), ('css', 'CSS'), ('javascript', 'JavaScript'), ('html', 'HTML'), ('python', 'Python'), ('toml', 'TOML'), ('yaml', 'YAML')], 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('code', 1), ('language', 2)]], {}), 4: ('picata.blocks.WrappedImageChooserBlock', (), {}), 5: ('wagtail.blocks.CharBlock', (), {'help_text': 'Optional heading for this list (e.g., Social Links).', 'required': False}), 6: ('wagtail.blocks.IntegerBlock', (), {'default': 2, 'help_text': 'Heading level for the list (1-6).', 'max_value': 6, 'min_value': 1, 'required': False}), 7: ('picata.blocks.HREFBlock', (), {'help_text': 'An optional link field', 'max_length': 255, 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'help_text': 'The title for the list item.', 'max_length': 50, 'required': True}), 9: ('wagtail.blocks.CharBlock', (), {'help_text': 'Id of the icon in the static/icons.svg file.', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.StructBlock', [[('href', 7), ('label', 8), ('icon', 9)]], {}), 11: ('wagtail.blocks.ListBlock', (10,), {'help_text': 'The list of items.'}), 12: ('wagtail.blocks.StructBlock', [[('heading', 5), ('heading_level', 6), ('items', 11)]], {}), 13: ('wagtail.blocks.StreamBlock', [[('link_list', 12)]], {'help_text': 'Add one or more heading-and-link-list blocks.', 'required': False}), 14: ('wagtail.blocks.StructBlock', [[('lists', 13)]], {})}, help_text='Main content for the split-view page.')),
|
82
82
|
],
|
83
83
|
options={
|
84
84
|
'verbose_name': 'split-view page',
|
@@ -90,9 +90,9 @@ class Migration(migrations.Migration):
|
|
90
90
|
name='Article',
|
91
91
|
fields=[
|
92
92
|
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
|
93
|
-
('tagline', models.CharField(blank=True, help_text='A short tagline for the article.')),
|
93
|
+
('tagline', models.CharField(blank=True, help_text='A short tagline for the article.', max_length=255)),
|
94
94
|
('summary', wagtail.fields.RichTextField(blank=True, help_text='A summary to be displayed in previews.')),
|
95
|
-
('content', wagtail.fields.StreamField([('rich_text', 0), ('code', 3), ('image', 4)], blank=True, block_lookup={0: ('wagtail.blocks.RichTextBlock', (), {}), 1: ('wagtail.blocks.TextBlock', (), {'help_text': None, 'required': True}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('
|
95
|
+
('content', wagtail.fields.StreamField([('rich_text', 0), ('code', 3), ('image', 4)], blank=True, block_lookup={0: ('wagtail.blocks.RichTextBlock', (), {}), 1: ('wagtail.blocks.TextBlock', (), {'help_text': None, 'required': True}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('plaintext', 'Plain Text'), ('bash', 'Bash'), ('css', 'CSS'), ('javascript', 'JavaScript'), ('html', 'HTML'), ('python', 'Python'), ('toml', 'TOML'), ('yaml', 'YAML')], 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('code', 1), ('language', 2)]], {}), 4: ('wagtail.images.blocks.ImageChooserBlock', (), {})}, help_text='Main content for the article.')),
|
96
96
|
('page_type', models.ForeignKey(blank=True, help_text='Select the type of article.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='picata.articletype')),
|
97
97
|
],
|
98
98
|
options={
|
picata/models.py
CHANGED
@@ -70,8 +70,16 @@ class BasePage(Page):
|
|
70
70
|
def get_publication_data(self, request: HttpRequest | None = None) -> dict[str, str]:
|
71
71
|
"""Helper method to calculate and format relevant dates for previews."""
|
72
72
|
site = self.get_site()
|
73
|
-
last_edited =
|
74
|
-
|
73
|
+
last_edited = (
|
74
|
+
self.latest_revision.created_at if self.latest_revision else self.last_published_at
|
75
|
+
)
|
76
|
+
year = (
|
77
|
+
self.first_published_at.year
|
78
|
+
if self.first_published_at
|
79
|
+
else last_edited.year
|
80
|
+
if last_edited
|
81
|
+
else None
|
82
|
+
)
|
75
83
|
published, updated = self.first_published_at, self.last_published_at
|
76
84
|
|
77
85
|
# Convert datetime objects to strings like "3 Jan, '25", or False, and
|
@@ -84,16 +92,18 @@ class BasePage(Page):
|
|
84
92
|
)
|
85
93
|
|
86
94
|
data = {
|
87
|
-
"
|
95
|
+
"live": self.live,
|
88
96
|
"url": self.relative_url(site),
|
89
97
|
"published": published_str,
|
90
98
|
"updated": updated_str,
|
99
|
+
"year": year,
|
91
100
|
}
|
92
101
|
|
93
102
|
# Add last draft date & preview URL if there's an unpublished draft, for logged-in users
|
94
103
|
if (
|
95
104
|
(request and request.user.is_authenticated)
|
96
105
|
and (not published or (updated and last_edited > updated))
|
106
|
+
and last_edited
|
97
107
|
and hasattr(self, "id")
|
98
108
|
):
|
99
109
|
data.update(
|
@@ -293,7 +303,9 @@ class Article(TaggedPage):
|
|
293
303
|
template = "picata/article.html"
|
294
304
|
objects = PageManager.from_queryset(ArticleQuerySet)()
|
295
305
|
|
296
|
-
tagline: CharField = CharField(
|
306
|
+
tagline: CharField = CharField(
|
307
|
+
blank=True, help_text="A short tagline for the article.", max_length=255
|
308
|
+
)
|
297
309
|
summary = RichTextField(blank=True, help_text="A summary to be displayed in previews.")
|
298
310
|
content = StreamField(
|
299
311
|
[
|
@@ -802,7 +802,7 @@ node_modules/yargs/README.md,sha256=X35C_t5SF6PmAX8Iho6HQ3kOiv4QCYJOl9ie_2Ygbls,
|
|
802
802
|
node_modules/yargs/node_modules/emoji-regex/README.md,sha256=XcNgKFkKhehLxMt3fimj8zMJteO40d28lX53Ca6D0MI,2706
|
803
803
|
node_modules/yargs-parser/README.md,sha256=TEMHLn6RYMSaxlW8Hp0hpCpovSzPAznkmPGqfzHme-U,9157
|
804
804
|
entrypoint.tsx,sha256=rXpHc3syUVomgTkY-xRwzmhjVD-ZHeymOXPBeSQloh8,8835
|
805
|
-
manage.py,sha256=
|
805
|
+
manage.py,sha256=4kq-i-T8aHvJP70jGibJ1hbmKhVrQFN8B0CJIN_4xTA,553
|
806
806
|
pygments.sass,sha256=zbDYpWda3EoGmjoC3JshZy-_CECNf6WU9abYPF8EHms,6369
|
807
807
|
styles.sass,sha256=SCG5WCr0jIGzdM_Vp_j_gKxFfcTsTwLWOmaEc6uMpvU,8501
|
808
808
|
components/HelloWorld.tsx,sha256=Kp7gvhGehfrX1mw0jgr2_D6AueFgqgfMYGkyQgvWekg,180
|
@@ -811,7 +811,7 @@ picata/apps.py,sha256=kr6OBcYbBw9HCGG-PkoMTHR4QeyzJO8_KIWTljCTHRo,1255
|
|
811
811
|
picata/blocks.py,sha256=bRfXFlY6solWHJiqrEX1vL5o2yN26k1Jl783FnkVyiE,5363
|
812
812
|
picata/log_utils.py,sha256=BRdB3PqpFx1XAhIyAzIOyQKiqrjbT3PBmkhH6-wAWJg,1555
|
813
813
|
picata/middleware.py,sha256=BbAifo--C4VYg1VhU8_qbdDcJUD9zYdbxU_9nqGpMa8,2067
|
814
|
-
picata/models.py,sha256=
|
814
|
+
picata/models.py,sha256=1CObj0fGETTX7U9EDIcqTsHHE_7MCqOolhCpeRjtCwM,16193
|
815
815
|
picata/transformers.py,sha256=CBnbIX3dnFV_gfp4TDTMPA_jGD8V_E4onodxWqbsjyY,2212
|
816
816
|
picata/urls.py,sha256=DlAOlkAeAHTCl4txY9rxtgc6vp822Ei2niiaiej29Sk,1988
|
817
817
|
picata/validators.py,sha256=X4wdIxbCdmuU-gJv45ptTFB7kHR166jkSQBJiTzP3ZU,1517
|
@@ -820,7 +820,7 @@ picata/wagtail_hooks.py,sha256=R1YgJwp_ZvYm65b_xvLS8HiBWxflXFXSB4SksbJxW3k,1500
|
|
820
820
|
picata/wsgi.py,sha256=5vKFvebtHzxKb3BRVqps6SEKjWmOecBIkTwf4LqWJ0Q,398
|
821
821
|
picata/helpers/__init__.py,sha256=acN445qKCuRVfInCEyCtx5W1BggloOSrawzdQ-c9m7s,2427
|
822
822
|
picata/helpers/wagtail.py,sha256=89efaXwd7V63ds3c7w0ct6IDp63RrXCf4pGNW9dvhCI,2118
|
823
|
-
picata/migrations/0001_initial.py,sha256=
|
823
|
+
picata/migrations/0001_initial.py,sha256=kWKEfc_k1hrffaZOOBw5Ay13OHzbd5W71dFHAYi6C1c,12067
|
824
824
|
picata/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
825
825
|
picata/settings/__init__.py,sha256=5qI40E9aCWsFanUxAnruZi1wXrad3oAwnusglycfPsk,47
|
826
826
|
picata/settings/base.py,sha256=_H0C0nEDK9ayVjPD9t0kWpLz-9jEhF65vfliKl2KCB8,9329
|
@@ -870,7 +870,7 @@ picata/templatetags/tags/absolute_static.py,sha256=JNqNCMGIgiQDYdz44T5AB2l0yJTd_
|
|
870
870
|
picata/templatetags/tags/menu_tags.py,sha256=PHuXl4QmIqycWilAyz1fjD_0uJxOSrCW7RnZxmR3Oh0,1860
|
871
871
|
picata/typing/__init__.py,sha256=7qXco9cqvbveKX0Xprrc8DmgXa3MpkIQXtFsHDe77os,405
|
872
872
|
picata/typing/wagtail.py,sha256=V0n9GYYb_CM5ic54lcRtpN6lhN37-QdRzz2mGKm3Cwc,664
|
873
|
-
picata-0.0.
|
874
|
-
picata-0.0.
|
875
|
-
picata-0.0.
|
876
|
-
picata-0.0.
|
873
|
+
picata-0.0.11.dist-info/METADATA,sha256=pfcq3ZYRu7gaPq9yhjBfw3TGSTCZP3MYTiXHUli62KU,5093
|
874
|
+
picata-0.0.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
875
|
+
picata-0.0.11.dist-info/licenses/LICENSE.md,sha256=Bv8sMyZI5NI6DMrfiAvCwIFRLSfJkimLF2KVcUMteKU,1103
|
876
|
+
picata-0.0.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|