Saravanan666/pypi-org huggingface dataset:
Package: wagtail-sb-structblock
Wagtail SB Struct BlockWagtail package to render render struct block with a tabbed interface to
distinguish between content fields an settings fields in struct blocks.RequirementsPython 3.8.1 or higherWagtail 3.0 or higherDjango 3.2 or higherInstallpipinstallwagtail-sb-structblockUsageAddwagtail_sb_structblockto yourINSTALLED_APPSsettingsINSTALLED_APPS=[# ..."wagtail_sb_structblock",# ...]In your struct blocks must inherith fromStructBlockand you must specify
thesettings_fieldsub yourMetaclass.fromwagtail.blocksimportStructBlockfromwagtail_sb_structblock.blocksimportStructBlockclassEnhancedHTMLBlock(StructBlock):text=CharBlock()html_attrs=CharBlock()classMeta:settings_fields=["html_attrs",]Include it in your stream file and your model so you can use a tabed interface
for your struct block.DocsEjemplosWikiChangelogAll changes to versions of this library are listed in thechange history.DevelopmentCheck out ourcontribution guide.ContributorsSee the list of contributorshere.
Package: wagtail-sendinblue
Wagtailintegration forSendInblue.InstallationInstall it with pip:pipinstallwagtail-sendinblueAddsendinblueto yourINSTALLED_APPS:INSTALLED_APPS=[# ...'sendinblue',# ...]Add thesendinblue.urlsto yoururls.py:fromsendinblueimporturlsassendinblue_urlsurlpatterns=[# ...url(r'',include(sendinblue_urls)),url(r'',include(wagtail_urls)),]ConfigurationGo to the Wagtail administration and inSettings > SendInBlueenter your API Key.
You need aSendInBlueaccount and
you can retrieve it yourSendInBlue administration.Automation supportThere is an optionnal support for Automation.You need to add the following at the end of your base Django template:{%sendinblue%}</body></html>or if usingdjango-jinja:{{sendinblue()}}</body></html>
Package: wagtail-seo
Wagtail SEOSearch engine and social media optimization for Wagtail.Source code on GitHub|Documentation|PyPIStatusPython PackageBuildGetting StartedFollow thegetting started guide.ContributingThe goal of Wagtail SEO is to become the most complete, go-to package for doing
SEO on Wagtail. This means it will not only provide the features, but will
continually stay up to date with evolving SEO practices and data standards (and
Google's whims). That being said we heartily welcome contributions!Follow thecontributing guideto get your development environment setup.AttributionIcon file "wagtailseo-line-chart.svg":Was sourced from the Fork Awesome project athttps://github.com/ForkAwesome/Fork-Awesome.Is licensed under the Creative Commons Attribution 3.0 Unported license,
a copy of which is available athttps://creativecommons.org/licenses/by/3.0/Has been modified from the original sources.
Package: wagtailset
Wagtail setWagtail anchors set.InstallationInstall usingpip:pip install wagtailsetTable of ContentsWagtail draftail anchorsWagtail draftail anchored internal linksWagtail Draftail AnchorsAdds the ability to add and edit anchors in the Draftail rich text editor, as well as automatically adding (slug-form) anchor ids to all headings with possibility to changes heading ids. Inspired bywagtail_draftail_anchorswith some improvements like possibility to edit previous anchor id and headings' ids.InstalationAdd'wagtailset.draftail_anchors'toINSTALLED_APPSbelowwagtail.admin.Add'anchor-identifier'to the features of any rich text field where you have overridden the default feature list.Note:'anchor-identifier' must be added before any heading('h1',...,'h6') feature and also before 'link' feature:body = RichTextField(features=['anchor-identifier', 'h2', 'h3', 'bold', 'italic', 'link'])Rendered representation of anchorsBy default,anchor-identifierrich text entities will be rendered as HTMLanchorelements, e.g.:<ahref="#my-element"id="my-element"data-id="my-element">My element</a>ConfigurationThis package provides an alternative renderer that rendersanchor-identifierentities as HTMLspanelements, e.g.:<spanid="my-element">My element</span>The desired renderer can be specified using theDRAFTAIL_ANCHORS_RENDERERsetting. To use thespanrenderer, configure your application as follows:DRAFTAIL_ANCHORS_RENDERER="wagtail_draftail_anchors.rich_text.render_span"It is possible to define your own renderer. It should be a callable that takes adictof attributes, and returns a string containing the opening tag of the HTML element that represents the anchor target. Thedictpassed to the renderer, for an anchor with an identifier of"my-anchor", would look like the following:{"data-id":"my-anchor","href":"#my-anchor","id":"my-anchor","linktype":"my-anchor"}If you define your own renderer, you should set the value ofDRAFTAIL_ANCHORS_RENDERERto your custom renderer's import path.Seerender_spanandrender_ainwagtail_draftail_anchors.rich_textfor examples.Wagtail Draftail Anchored Internal LinksAdds the ability to add (and edit) anchors to the internal links in the Draftail rich text editor.InstalationInstalled by default. No extra configuration needed.How it worksAdd anchor to the internal link:Edit anchor of the internal link:Rendered representation of anchorsBy default,linkrich text entities will be rendered as HTML with anchor in the end if it is set, e.g.:Database representation:<ahash="header-1"id="3"linktype="page">bla</a>HTML representation:<ahref="/page3/#header-1">bla</a>
Package: wagtail-shell
Wagtail ShellWagtail Shell is an experimental frontend for Wagtail admin that converts it into a single-page-application and improvements to the left hand menu.Features:No page reloads for general navigation!Left hand menu rewritten in React, with improved animations and a new collapsed modeSupport for views written for different frontend frameworks, such as Django adminA new modal workflow UI that supports rendering any view in a modalComing soon:Ability to write new API-driven views entirely in JavaScript (using React, Vue, or something else)What does it look like?InstallationPlease note that this project is still very much experimental, is not very well tested, and is likely to change in backwards-incompatible ways without noticeBut if you'd like help this project by being an early tester, here's how to install!Installwagtail-shellwith pip:pip install wagtail-shellAdd it toINSTALLED_APPS:# settings.pyINSTALLED_APPS=[# ...# Must be above wagtail.admin'wagtail_shell',# ...]Decorate all Wagtail admin URLs withshell_enableusing Wagtail'sdecorate_urlpatternshelper:# urls.pyfromdjango.conf.urlsimportinclude,urlfromwagtail.adminimporturlsaswagtailadmin_urlsfromwagtail.utils.urlpatternsimportdecorate_urlpatternsfromwagtail_shell.decoratorsimportshell_enableurlpatterns=decorate_urlpatterns([# All URLs that you want to use the Wagtail menu on go here# You can also add Django admin or custom views here if you want to!url(r'^admin/',include(wagtailadmin_urls)),],shell_enable)+[# All other URLs here]
Package: wagtail-shop
Wagtail Shop=====Simple shop based on [django-oscar](https://github.com/django-oscar/django-oscar).**NB: This is currently in beta**Quick start-----------1. `pip install wagtail-shop`2. Add `from oscar.defaults import *` to your settings.py file.3. Import and append `get_core_apps()` to your INSTALLED_APPS, and add required packages like this:```from wagtail_shop import get_core_appsINSTALLED_APPS = [...'django.contrib.sites','django.contrib.flatpages','wagtail.contrib.routable_page','wagtail.contrib.modeladmin','widget_tweaks',] + get_core_apps()```4. Add `oscar.apps.basket.middleware.BasketMiddleware` to your MIDDLEWARE5. Run migrations `./manage.py migrate`6. Before you can add any products you must create at least one `Product Type` and add one `Partner` in the Wagtail admin interface.What's next?------------You should now be able to follow the [django-oscar documentation](https://django-oscar.readthedocs.io) for further details.There are a few exceptions:1. Instead of using `./manage.py oscar_fork_app` when forking an app, use `./manage.py wagtail_shop_fork_app`.2. If setting up with the default templates provided with django-oscar, the images won't work, and you would have to update the image tags in the template to use [Wagtails image tags](https://docs.wagtail.io/en/latest/topics/images.html)Screenshots-----------![Product detail](/screenshots/product-list.png?raw=true "Product list")![Product detail](/screenshots/product-detail.png?raw=true "Product detail")
Package: wagtail-shortcode
Wagtail shortcodeWagtail shortcode adds a custom Draftail enitity to provide a custom linktype ("shortcode"), giving you the ability to assign values in a similar way to normal links as well as decide how they should be rendered on the page.Installationpython -m pip install wagtail-shortcode...Add'wagtail_shortcode'toINSTALLED_APPS.Register aLinkHandler, to control how the new linktype renders on the front-end (|richtextfilter).LinkHandlers must be registered within a wagtail_hooks.py file under an app directory and use an identifier matchingSHORTCODE_ANCHOR_TARGET_IDENTIFIER, for example:# ./utils_app/wwgtail_hooks.pyfromdjango.utils.htmlimportescapefromwagtailimporthooksfromwagtail.rich_textimportLinkHandlerfromwagtail_shortcode.handlersimportSHORTCODE_ANCHOR_TARGET_IDENTIFIERclassCustomShortcodeLinkHandler(LinkHandler):identifier=SHORTCODE_ANCHOR_TARGET_IDENTIFIER@classmethoddefexpand_db_attributes(cls,attrs):href=attrs["shortcode"]# Do something cleverreturn'<a href="%s">'%escape(href)@hooks.register("register_rich_text_features")defregister_shortcode_link(features):features.register_link_type(CustomShortcodeLinkHandler)Addshortcodeto thefeaturesargument of any rich text field where you have overridden the default feature list:classHeader(models.Model):content=RichTextField(features=["shortcode","h2","h3","bold","italic","link"])ConfigurationUpdating the window prompt's help-textWhen adding shortcode within the editor, a window prompt will appear, the text within this prompt can be customised by providing a value forSHORTCODE_HELP_TEXTwithin your project's settings file. This can be helpful as to inform editors of the expected behaviour of your custom LinkHandler.SHORTCODE_HELP_TEXT="Enter a shortcode value"The window.prompt function is a JavaScript method which supports basic text formatting using special characters, as such a newline character can be included using\nif needed.ContributingSee docs.
Package: wagtail-showsimilar
wagtail-showsimilarDisplay similar items by field value from wagtail search results.Quick StartInstallationpipinstallwagtail-showsimilarSetupAddwagtailshowsimilarto yoursettings.pyin theINSTALLED_APPSsection:INSTALLED_APPS=[...'wagtailshowsimilar',]Add admin urlsfromwagtailshowsimilar.urlsimporturlpatternsasshowsimilar_admin_urlsurlpatterns=[...path('admin/showsimilar/',include(showsimilar_admin_urls)),path('admin/',include(wagtailadmin_urls)),...]ShowSimilarPanelThe model should be searchable to work with wagtail-showsimilar, All pages, images and documents are searchable by default in Wagtail.Optionsscore_threshold(int/float) - Only score for matched results above this value will be listing. This field only works with Elasticsearch backend. (default: 20)max_items(int) - Maximum number of listing items shown from search results. (default: 10)fromdjango.dbimportmodelsfromwagtail.searchimportindexfromwagtailshowsimilar.edit_handlersimportShowSimilarPanelclassBreadType(index.Indexed,models.Model):title=models.CharField(max_length=255)panels=[ShowSimilarPanel('title',score_threshold=5),]search_fields=[index.SearchField('title',partial_match=True)]You'll need to inherit fromindex.Indexedfor custom models and add somesearch_fieldsto the model. For more information, please seeIndexing custom models.(Optional) Implementget_showsimilar_urlThe result list items create links to the edit view for Page models by default.
It's also possiable to implement get_showsimilar_url to customize link URL forPage,Image,Documentor custom models.fromdjango.urlsimportreverseclassBreadType(index.Indexed,models.Model):...defget_showimilar_url(self):returnreverse("breads_breadtype_modeladmin_edit",args=(self.id,))
Package: wagtail-simple-math-captcha
A simple math captcha field for Wagtail Form Pages based on Django Simple Math Captcha.wagtail-simple-math-captcha provides a way to integratedjango-simple-math-captchain a Wagtail form. The code is based onwagtailsweetcaptchaInstallationInstallwagtail-simple-math-captcha.AddwagtailsimplemathcaptchatoINSTALLED_APPSin yoursettings.py.UsageWhen you installwagtail-simple-math-captchayou won’t get a captcha
field in the available field types in the form builder. To use it you
need to subclass eitherMathCaptchaFormorMathCaptchaEmailForm(replacements forAbstractFormandAbstractEmailFormrespectively). After you do that the captcha field will appear in your
frontend:frommodelcluster.fieldsimportParentalKeyfromwagtail.wagtailadmin.edit_handlersimport(FieldPanel,InlinePanel,MultiFieldPanel)fromwagtail.wagtailcore.fieldsimportRichTextFieldfromwagtail.wagtailforms.modelsimportAbstractEmailForm,AbstractFormFieldfromwagtailsimplemathcaptcha.modelsimportMathCaptchaEmailFormclassFormField(AbstractFormField):page=ParentalKey('FormPage',related_name='form_fields')classFormPage(MathCaptchaEmailForm):intro=RichTextField(blank=True)thank_you_text=RichTextField(blank=True)# wagtail-simple-math-captcha configurationcaptcha_label=""captcha_help_text="Answer this question to prove you're human."FormPage.content_panels=[FieldPanel('title',classname="full title"),FieldPanel('intro',classname="full"),InlinePanel('form_fields',label="Form fields"),FieldPanel('thank_you_text',classname="full"),MultiFieldPanel([FieldPanel('to_address',classname="full"),FieldPanel('from_address',classname="full"),FieldPanel('subject',classname="full"),],"Email")]You can configure the field’sverbose_nameandhelp_textproperties by includingcaptcha_labelandcaptcha_help_textproperties in the class or overridingget_captcha_label()andget_captcha_help_text()methods:frommodelcluster.fieldsimportParentalKeyfromwagtail.wagtailadmin.edit_handlersimport(FieldPanel,InlinePanel,MultiFieldPanel)fromwagtail.wagtailcore.fieldsimportRichTextFieldfromwagtail.wagtailforms.modelsimportAbstractEmailForm,AbstractFormFieldfromwagtailsimplemathcaptcha.modelsimportMathCaptchaEmailFormclassFormField(AbstractFormField):page=ParentalKey('FormPage',related_name='form_fields')classFormPage(MathCaptchaEmailForm):intro=RichTextField(blank=True)thank_you_text=RichTextField(blank=True)# wagtail-simple-math-captcha configurationdefget_captcha_label(self):return""defget_captcha_help_text(self):return"Answer this question to prove you're human."FormPage.content_panels=[FieldPanel('title',classname="full title"),FieldPanel('intro',classname="full"),InlinePanel('form_fields',label="Form fields"),FieldPanel('thank_you_text',classname="full"),MultiFieldPanel([FieldPanel('to_address',classname="full"),FieldPanel('from_address',classname="full"),FieldPanel('subject',classname="full"),],"Email")]The defaults for bothcaptcha_labelandcaptcha_help_textis
emty string.
Package: wagtail-site-check
Wagtail Site CheckA Wagtail app to check the configuration of Wagtail Sites.Have you ever experienced a failing Wagtail preview? Searching for hours, only to find out a misconfiguration of Wagtail Site objects?
Misconfiguration of hostname and port happens often, goes unnoticed for a while, and leads to vague complaints.When a Wagtail Site is misconfigured, developers like to be notified. This way, the issue can be addressed quickly. To scratch the itch, I created "Wagtail Site Check".InstallationInstall the package with pip:python-mpipinstallwagtail-site-checkAdd the app to yourINSTALLED_APPS:INSTALLED_APPS=['wagtailsitecheck',]AddALLOWED_WAGTAIL_SITESto your settings:ALLOWED_WAGTAIL_SITES=["a.com:443","b.com:443","c.com:443",]When working with multiple environments (DTAP), only specify the allowed wagtail sites for that environment. For example viaenvironment variables.UsageThe app provides two management commands:checksitesandfixsites.It also provides aSiteCheckNotificationPanelto add a warning to the Wagtail admin dashboard.Check SitesThechecksitesmanagement commandfails hardif an existing Wagtail Site object is not defined inALLOWED_WAGTAIL_SITES.pythonmanage.pychecksitesRun this command manually, or add it to your CI/CD pipeline. For example, just aftermigrate.Fix SitesThefixsitesmanagement command helps to re-configure the sites.pythonmanage.pyfixsites127.0.0.1:8000isnotinALLOWED_WAGTAIL_SITES.Specifyanumbertoupdatethesite.1:a.com:4432:b.com:4433:c.com:4431Updated127.0.0.1:8000->a.com:443SiteCheckNotificationPanelTo show a warning on the Wagtail admin dashboard addSiteCheckNotificationPaneltowagtail_hooks.py. The warning is only displayed if there are misconfigured sites.fromwagtailimporthooksfromwagtailsitecheck.wagtail_hooksimportSiteCheckNotificationPanel@hooks.register('construct_homepage_panels')defadd_site_check_panel(request,panels):panels.append(SiteCheckNotificationPanel())
Package: wagtail-snippet-image
Package for creating a snippet images for sharing in social networks and etc.
Based ondjango-snippet-imageandsnippet-image.
But for storage of images used WagtailImages.Installationpip3 install wagtail-snippet-imageHow use itfromdjango.db.modelsimport(CharField,ForeignKey,SET_NULL,CASCADE,)fromwagtail_snippet_imageimportSnippetImageFieldfromwagtail.core.modelsimportPagefromwagtail.admin.edit_handlersimportFieldPanelfromwagtail.images.edit_handlersimportImageChooserPanelfrommodelcluster.fieldsimportParentalKeyfrommodelcluster.contrib.taggitimportClusterTaggableManagerfromtaggit.modelsimportTaggedItemBaseclassPageTag(TaggedItemBase):content_object=ParentalKey('home.HomePage',on_delete=CASCADE,related_name='tagged_items',)classStatuses:DRAFT='draft'PUBLISH='publish'CHOICES=((DRAFT,'Draft'),(PUBLISH,'Publish'),)classHomePage(Page):background=ForeignKey('wagtailimages.Image',verbose_name='Изображение для обложки',related_name='cover_images',on_delete=SET_NULL,blank=True,null=True,)snippet_image_field=SnippetImageField(verbose_name='Example snippet image field',null=True,)status=CharField(max_length=20,choices=Statuses.CHOICES,default=Statuses.DRAFT,)tags=ClusterTaggableManager(through=PageTag,blank=True)content_panels=Page.content_panels+[ImageChooserPanel('background'),ImageChooserPanel('snippet_image_field'),FieldPanel('status'),FieldPanel('tags'),]defget_snippet_image_background(self,snippet_type):returnself.backgroundandself.background.fileandself.background.file.path\ifsnippet_type=='default'elseNonedefget_snippet_image_center(self,snippet_type):return(self.background.focal_point_x,self.background.focal_point_y)\ifsnippet_type=='default'andself.background\andself.background.focal_point_xandself.background.focal_point_y\elseNonedefget_snippet_image_text(self,snippet_type):returnself.titleifsnippet_type=='default'elseNonedefsnippet_image_should_be_created(self):returnself.status==Statuses.PUBLISH# Wagtail custom methods for create wagtail images for sharing snippet imagedefget_snippet_image_title(self,snippet_type):returnself.titleifsnippet_type=='default'elseNonedefget_snippet_image_tags(self,snippet_type):returnself.tags.names()ifsnippet_type=='default'elseNoneAnd use it in template:<metaproperty="og:image"content="{{ image(page.snippet_image_field, 'original') }}"/>Read more inhome.
Package: wagtailsnippetscopy
'Copy A Snippet' Feature for Wagtail CMSYou can now "copy" snippets (non-page models) in Wagtail CMSInstallationInstall the python package wagtailsnippetscopy from pippip install wagtailsnippetscopyAlternatively, you can install download or clone this repo and callpip install -e ..Add to INSTALLED_APPS in yoursettings.py:'wagtailsnippetscopy',Register a model (with a title field name) you wish to enable copy functionality for:fromwagtailsnippetscopy.registryimportsnippet_copy_registrysnippet_copy_registry.register(YourModel,{})Add SnippetCopyMixin to your Snippet model in order to enable get_copy_url callback() for the model:fromwagtailsnippetscopy.modelsimportSnippetCopyMixinclassGraph(SnippetCopyMixin,models.Model):If you wish copy link to automatically appear in modeladmin list you should add SnippetCopyModelAdminMixin to the ModelAdmin class:In admin.py:fromwagtail.contrib.modeladmin.optionsimportModelAdmin,modeladmin_registerfromwagtailsnippetscopy.adminimportSnippetCopyModelAdminMixinfrom.modelsimportYourModelclassYourModelAdmin(SnippetCopyModelAdminMixin,ModelAdmin):model=YourModelmodeladmin_register(GraphAdmin)Copy link follows the following pattern:/admin/copy-snippet/<app_label>/<model_name>/<object_id>/Bugs and suggestionsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/timonweb/wagtailsnippetscopy/issuesbyTim Kamanin
Package: wagtailsocialfeed
Wagtail Social FeedA Wagtail module that provides pages and content blocks to show social media feedsDocumentation:https://wagtailsocialfeed.readthedocs.io.FeaturesA wagtail settings sections to configure social media sourcesSocial feed moderate viewSocial feed content blockSocial feed Page typeImplementationsThe following social media sources are supported:TwitterFacebookInstagramCHANGELOG0.4.1 (13-12-2017)Fix on Instagram feed which was no longer available0.4.0 (16-08-2017)Dropped support for Wagtail 1.6, 1.7Added support for Wagtail 1.9, 1.10 and 1.110.3.0 (28-10-2016)Added dimensions when returning the attached Twitter ImageFixes Facebook support: initially developed on2.1while the GraphAPI assumes2.8.Added Facebook field configurationAdded Twitter options via default config0.2.0 (06-10-2016)Added Facebook supportAdded ability to mix all the feeds; just leave feedconfig empty inSocialFeedPageorSocialFeedBlock.Made all returned data avaiable inFeedItemobjects, even if it is not stored explicitly.0.1.0 (27-09-2016)Fixed PyPI long_description format errorFixed value_for_form error in FeedChooserBlock0.1.dev4 (27-09-2016)Made looping over multiple result pages more DRYImproved moderate page titleFixed AttributeError in FeedChooserBlock.value_for_form0.1.dev3 (11-09-2016)Updated license model to BSD0.1.dev2 (04-09-2016)Added block type ‘SocialFeedBlock’Added SocialFeedModerateMenu which live detects configuration changesAdded FeedItem to consolidate the item/post structureAdded search functionality to the Feed objectsDropped Wagtail 1.5 support in favour of using the IntegerBlock0.1.dev1 (01-09-2016)First implementation
Package: wagtail-spa-routing
Установкаpip install wagtail-spa-routingПодключениеДобавить вINSTALLED_APPS:'wagtail_spa.apps.WagtailSpaConfig',Подключить роуты вurls.py:path('api/wagtail-spa/', include('wagtail_spa.urls', namespace='wagtail_spa')),Для добавления возможности возврата драфтового объекта, использоватьRetrieveDraftMixin, который основан наrest_framework.mixins.RetrieveModelMixinи предполагает что вид возвращает объект методомget_object.
Package: wagtail-stacks-embed
# wagtail-stacks-embedA Stacks application for handling embeddable media (like COVE Videos, YouTube Videos or Soundcloud sounds…basically anything that uses an embed code!).## Release Notes### 0.3Adds PBS passport integration forwagtail_stacks_embed.pbs_cove### 0.2StacksEmbed is now a searchable snippet.### 0.1.1Merging in tools-rework branch (forgot to do this prior to 0.1 release!)### 0.1Initial open source release