wagtail

Wagtail set additional permissions for MyPage

江枫思渺然 提交于 2019-12-10 19:47:12
问题 Wagtail newbie here. I am trying to add some additional permissions to specific models, but nothing shows up into the "wagtail admin". I can do this the "django" way but I have the impression that wagtail could handle this type of permissions. I could not find any hints in the wagtail documentation. I have a new model named "MyPage": class MyPage(Page): [...] class Meta: permissions = ( ('view_restricted_document', 'can view restricted documents'), ) How do I make this permission available in

content_panels in StreamBlock StreamField

时光总嘲笑我的痴心妄想 提交于 2019-12-10 18:25:10
问题 I have a few custom StreamField blocks defined. I'd like the option to be able to collapse some properties within the custom blocks much like i can do with a standard page model using content_panels however I don't believe this is supported. Correct? 回答1: It does not appear that this is possible without writing some custom css/js for your admin pages. There is one work around solution for collapsing one StreamFieldPanel inside a standalone MultiFieldPanel , however this is not for blocks

Migration error with Django 1.7.1

家住魔仙堡 提交于 2019-12-10 13:39:26
问题 I'm getting an error when performing a migration after introducing a new app (django-allauth). I'm not sure what else to try in order to fix the error. I've tried a few things but they don't seem to help unfortunately. when running manage.py migrate : File "D:\Python27\Lib\site-packages\django\db\migrations\state.py", line 71, in render raise InvalidBasesError("Cannot resolve bases for %r\nThis can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)\n in an app

Wagtail MultiSite - Cross posting content

感情迁移 提交于 2019-12-10 10:30:58
问题 I am currently building two sites out of a single Wagtail installation. The sites are for a company and it's sister company and there is some overlap in content. Ideally we don't want to have to post the same content twice. In particular we have an Events page on both sites and there may be events that are relevant to both companies. The problem is that a Wagtail page can only exist in one place in the tree at once. I have considered creating a "MirroredEventPage" model with only one foreign

Wagtail: Filter results of an InlinePanel ForeignKey

∥☆過路亽.° 提交于 2019-12-10 08:42:50
问题 These models allow me to establish multiple human "editors" for a tool: class ToolPageEditors(models.Model): person = models.ForeignKey('people.UserProfile') page = ParentalKey('ToolPage', related_name='toolpage_editors') class ToolPage(BaseAsset): content_panels = BaseAsset.content_panels + [ InlinePanel('toolpage_editors', label="Tool Editors") ] But then each ToolPageEditors instance is a dropdown with more than 3,000 users. I'd like to limit the contents of that dropdown to people in a

How to change django wagtail's admin logo

社会主义新天地 提交于 2019-12-09 12:34:54
问题 I am working on a small project and I thought I'd give wagtail a try. I am now wondering how I could change wagtail's admin logo in the sidebar (top left image on the picture bellow). I could change /static/wagtailadmin/images/wagtail-logo.svg directly but it'd be wrong ;). 回答1: Wagtail already provide the solution in the official documentation using django-overextends: To replace the default logo, create a template file your_app/templates/wagtailadmin/base.html that overrides the block

Nested categories/InlinePanel(s) in wagtail

泪湿孤枕 提交于 2019-12-09 06:07:39
问题 I struggle to implement something like "nested categories": PageA: - Cat1 - SubCat1 - SubCat2 - ... - Cat2 - SubCat1 - ... All categories and subcategories should be orderable and editable by an editor. My guess was something like this: class CategoryTestPage(Page): content_panels = Page.content_panels + [ InlinePanel('categories') ] class Category(Orderable,ClusterableModel,models.Model): page = ParentalKey(CategoryTestPage, related_name='category') category = models.CharField(max_length=250

What is the correct way to extend Wagtail abstract models with extra fields?

对着背影说爱祢 提交于 2019-12-08 10:20:13
问题 I have an abstract Wagtail model with a few StreamField s. Two of these StreamField s are in a separate tab in the admin view, which are added to the edit_handler . class AbstractHomePage(Page): body = StreamField( HomePageStreamBlock(), default='' ) headingpanel = StreamField( HeadingPanelStreamBlock(), default='' ) sidepanel = StreamField( SidePanelStreamBlock(), default='' ) class Meta: abstract = True search_fields = Page.search_fields + [index.SearchField('body')] content_panels = Page

Amazon S3 to store Wagtail media files - server 500 error on Heroku only

可紊 提交于 2019-12-08 05:55:21
问题 I have been following the Using Amazon S3 to Store Wagtail Media Files blog post to set up amazon s3 to store my wagtail media files This works perfectly on my local development sever (all of the images appear in the S3 bucket as expected). However in deployment on Heroku I get a server 500 error just as the uploader completes and the images are not saved in the S3 bucket. There is no detail in the heroku logs other than this line. Which makes it very difficult to debug. I am not using S3 for

create collection with python code

流过昼夜 提交于 2019-12-08 04:30:07
问题 i would like to make a model that will allow the user in the Wagtail admin site to choose a directory of images give the name of the collection in a CharField and upon a button press a collection with the given name would be created, then the images from a the given directory would then be saved to the database (so that they are avaialable in the CMS). The title of the image would be it's filename, while it's tag would be the directory name where the image is found. I found another post on