Move accounts snippet to new contact app
This commit is contained in:
parent
675d3f38b9
commit
9b7a2b2c21
8 changed files with 66 additions and 16 deletions
16
website/common/migrations/0016_delete_onlineaccount.py
Normal file
16
website/common/migrations/0016_delete_onlineaccount.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Generated by Django 4.0.5 on 2022-07-20 07:52
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("common", "0015_alter_contentpage_body_alter_listingpage_body"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name="OnlineAccount",
|
||||
),
|
||||
]
|
|
@ -123,19 +123,3 @@ class ReferralLink(models.Model):
|
|||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
|
||||
|
||||
@register_snippet
|
||||
class OnlineAccount(models.Model):
|
||||
name = models.CharField(max_length=64, unique=True)
|
||||
url = models.URLField()
|
||||
username = models.CharField(max_length=64)
|
||||
|
||||
panels = [
|
||||
FieldPanel("name"),
|
||||
FieldPanel("username"),
|
||||
FieldPanel("url"),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
|
|
0
website/contact/__init__.py
Normal file
0
website/contact/__init__.py
Normal file
30
website/contact/migrations/0001_initial.py
Normal file
30
website/contact/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Generated by Django 4.0.5 on 2022-07-20 07:52
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [] # type: ignore
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="OnlineAccount",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=64, unique=True)),
|
||||
("url", models.URLField()),
|
||||
("username", models.CharField(max_length=64)),
|
||||
],
|
||||
),
|
||||
]
|
0
website/contact/migrations/__init__.py
Normal file
0
website/contact/migrations/__init__.py
Normal file
19
website/contact/models.py
Normal file
19
website/contact/models.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from django.db import models
|
||||
from wagtail.admin.panels import FieldPanel
|
||||
from wagtail.snippets.models import register_snippet
|
||||
|
||||
|
||||
@register_snippet
|
||||
class OnlineAccount(models.Model):
|
||||
name = models.CharField(max_length=64, unique=True)
|
||||
url = models.URLField()
|
||||
username = models.CharField(max_length=64)
|
||||
|
||||
panels = [
|
||||
FieldPanel("name"),
|
||||
FieldPanel("username"),
|
||||
FieldPanel("url"),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
|
@ -28,6 +28,7 @@ INSTALLED_APPS = [
|
|||
"website.search",
|
||||
"website.blog",
|
||||
"website.images",
|
||||
"website.contact",
|
||||
"website.contrib.code_block",
|
||||
"website.contrib.mermaid_block",
|
||||
"website.contrib.unsplash",
|
||||
|
|
Loading…
Reference in a new issue