F
F
Finger Gross2016-10-30 21:51:14
Django
Finger Gross, 2016-10-30 21:51:14

Is it possible to add just a model to the wagtail admin?

Good afternoon)
Is it possible to add a non- child Page model to the wagtail admin panel ? For example:

class Order(models.Model):
    created = models.DateField()
    # ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
StasShk, 2016-10-31
@GrossFinger

Of course you can. Everything that was in Django continues to work here.
You can use snippets :

@register_snippet
class Order(models.Model):
    created = models.DateField()

    panels = [
        FieldPanel('created '),

This option if the model will be displayed on several pages.
Or you can simply link the model to the page via ForeignKey or ParentalKey.
All this is even in the training demo .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question