18 lines
401 B
Python
18 lines
401 B
Python
from django.db import models
|
|
|
|
from wagtail.admin.edit_handlers import FieldPanel
|
|
from wagtail.snippets.models import register_snippet
|
|
|
|
|
|
@register_snippet
|
|
class Advert(models.Model):
|
|
url = models.URLField(null=True, blank=True)
|
|
text = models.CharField(max_length=255)
|
|
|
|
panels = [
|
|
FieldPanel('url'),
|
|
FieldPanel('text'),
|
|
]
|
|
|
|
def __str__(self):
|
|
return self.text
|