0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-24 10:58:52 +01:00
Commit Graph

140 Commits

Author SHA1 Message Date
Mikalai Radchuk
eb47526888 Enhancement for PageChooserBlock
Allow the target_model argument to be a list or tuple.
2017-02-17 11:30:32 +00:00
Matt Westcott
bd9455a11b Document wagtailsearch settings for Amazon Elasticsearch Service (#3345)
Resolves #2776
2017-02-08 18:58:24 +00:00
Matt Westcott
19310a84ed Documentation and release notes for #3275 2017-01-16 18:51:42 +00:00
Mikela Clemmons
26b7071307 RegexBlock error_message typo in docs
In the documention an example had a singular
2017-01-13 10:06:19 +00:00
Nikolai R Kristiansen
54bfd1a802 docs: Fix INDEX_SETTINGS in ES search backend ex.
The key `number_of_shards` lives below the `index` key.

Ref: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-create-index.html#create-index-settings
2017-01-06 11:23:16 +00:00
J. Heasly
9424a8eab9 Give indication that there may be other template bits necessary for tag to work.
I came to this page from "Getting Started" template examples where all pages examples are rendered within {% block content %} tags which are not in these template examples."
;
2017-01-05 10:14:07 +00:00
Matt Westcott
5e13a1d674 Remove old versionadded line 2016-12-15 16:23:05 +00:00
Matt Westcott
6f834c9a9b Update links to github.com/torchbox to point to github.com/wagtail 2016-12-15 11:49:49 +00:00
pyMan
7d1114c1a1 Extra ES params passed through new OPTIONS key
Closes #2778

Extra ES params are now passed through new OPTIONS key in the
WAGTAILSEARCH_BACKENDS setting.

It's backward compatible: if no OPTIONS key is found and some parameters
still exist, those parameters are used for the ES constructor..
2016-12-01 12:04:14 +00:00
Karl Hobley
18316d627d Added Elasticsearch 5 to search backend docs 2016-11-30 16:31:20 +00:00
Scot Hacker
2882775842 Add BlockQuoteBlock to core block types 2016-11-29 10:13:10 +00:00
Mikalai Radchuk
55bdae573b Add support of callable choices for ChoiceBlock
Fixes #2809
2016-11-28 17:44:35 +00:00
Tim Heap
16213db0f8 Remove old versionadded notes
A step has been added to the release process notes to do this for future
releases as well.

https://github.com/torchbox/wagtail/wiki/Creating-a-new-Wagtail-release
2016-11-28 13:41:35 +00:00
Tim Heap
6ba34636cb Fix whitespace errors in docs
Trimmed trailing whitespace, convert tabs to 4 spaces, add preference
for spaces to `.editorconfig`.
2016-11-28 13:41:35 +00:00
Tim Heap
254e675634 Use .. code-block:: console for all shell commands
This is the correct lexer for interactive console sessions, according to
<http://pygments.org/docs/lexers/>. This does require command lines to
be prefixed with `$`, otherwise they are interpreted as the output of a
command. It highlights the command nicely, including environment
variables, strings, and comments.
2016-11-28 13:41:35 +00:00
Tim Heap
f742d4a476 Use .. code-block:: for all python, html blocks 2016-11-28 13:41:34 +00:00
Benoit Vogel
2fba07ad8e Implemented StaticBlock
Uses admin_text which is a Meta attribute.
* StaticBlock code in wagtailcore/blocks + tests
* StaticBlock in Streamfield docs
2016-11-15 10:29:06 +00:00
Matt Westcott
59e9a31bc1 Document the fact that a matching version of the elasticsearch package must be used 2016-11-04 11:14:12 +00:00
Matt Westcott
8de1b1b16f Release note for #3035 2016-11-03 16:58:54 +00:00
Matt Westcott
1b2cb50a84 Add documentation for bulk delete permission 2016-11-03 16:58:50 +00:00
Matt Westcott
5c9fc29fbe Mention that deleting a published page requires publish permission 2016-11-03 16:10:11 +00:00
Matt Westcott
e681cb3626 Add documentation about permission configuration 2016-11-03 16:10:09 +00:00
Tim Heap
9d54031a50 Add PageChooserBlock target_model option
It allows selecting a restricted subset of pages, like with the
PageChooserPanel
2016-10-26 13:01:46 +01:00
Matt Westcott
a326cd8559 Custom Page Manager documentation fix
Thanks to @nimasmi for reporting!
2016-10-25 11:48:02 +01:00
Matt Westcott
534b5d1fd9 Release note for #2474 2016-10-05 16:03:54 +01:00
Karl Hobley
2a6f908972 Various docs tweaks
Thanks @tomdyson for spotting!
2016-10-05 15:54:05 +01:00
Karl Hobley
6c57b5b280 Docs for format and jpegquality image filters
This also fixes #1205
2016-10-05 15:54:05 +01:00
Karl Hobley
9a57e39cfd Implemented annotate_score on SearchResults
This allows the user to retrieve the scores for each search result:

    for page in Page.objects.search("Hello").annotate_score('_score'):
        print(page.title, page._score)
2016-09-22 12:03:23 +01:00
Mikalai Radchuk
5598910a2b Release notes for #2573 2016-08-31 14:13:47 +03:00
Karl Hobley
daa82936d7 Elasticsearch 2 support (#2573)
* Created Elasticsearch 2 backend

* Added tests for Elasticsearch 2 backend

* Split models up into different indices

pages, images and documents are now in separate indices

* Prefix fields of child models to prevent mapping clashes

* Replaced index_analyzer with analyzer/search_analyzer

index_analyzer has been removed in Elasticsearch 2.0

https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html#_analyzer_mappings

There's no indication in Elasticsearch's docs that this wouldn't work on Elasticsearch 1.x. However, we found that the new configuration isn't reliable on Elasticsearch 1.6 and below (causes the test_query_analyzer test to fail randomly).

* Implemented new way of representing content types in search index

Instead of using a long string of model names that is queried using a
"prefix" query, we instead use a multi-value string field and query it
using a simple "match" query.

The only reason why this isn't implemented in the Elasticsearch 1.x
backend yet is backwards compatibility

* Added another child model of SearchTest with clashing field mapping

This checks that the namespacing of fields on child models is working properly (if it doesn't the update_index tests will fail)

* Added tests for get_model_root function

* fixup! Added tests for get_model_root function

* Docs updates for Elasticsearch 2 support

Also tweak examples to use elasticsearch2 backend by default

* Test against Elasticsearch 2 on travis
2016-08-31 13:46:57 +03:00
Karl Hobley
e29f9b2423 No longer say that ATOMIC_REBUILD is "Experimental"
We've used this in production on a few sites for over a year now and haven't hit any problems.
2016-08-31 09:54:35 +01:00
Matt Westcott
7bc819640d Restore PageManager behaviour by setting it on an abstract superclass of Page
Django's standard behaviour is to preserve managers that are set on abstract
superclasses, so this allows us to eliminate the metaclass hackery.

Fixes #2933
2016-08-23 20:12:22 +01:00
David Burke
db54a9f0c4 Update IntegerBlock docs to show correct kwargs (#2930)
It should be max and min value - not length. See [here](07c3ba84fb/wagtail/wagtailcore/blocks/field_block.py (L306)).

So this would work 

`blocks.IntegerBlock(max_value=10, min_value=0)`

but this wouldn't do anything

`blocks.IntegerBlock(max_length=10, min_length=0)`
2016-08-20 02:38:00 +01:00
Matt Westcott
bc7739e104 Add usage examples for EmailBlock, IntegerBlock, DecimalBlock
Thanks to @OktayAltay for the original pull request.
2016-08-08 20:15:45 +01:00
Nik Nyby
389317c104 docs: fix typo (#2845) 2016-07-15 21:58:47 +03:00
Matt Westcott
be1e1927c5 Promote include_block and unicode page slugs to major features 2016-07-07 11:20:43 +01:00
Matt Westcott
dbc4c9b28e Adds the include_block template tag (#2786)
Update render and render_basic methods on Block to take a context kwarg

Update TableBlock to support passing extra context to render

Implement render_as_block on BoundBlock, StreamValue and StructValue.

Collectively, these are the objects encountered during template rendering which typically render
a block template when output inside {{ ... }} tags. Implementing render_as_block allows us to do
the same thing, but passing a template context as well.

Implement include_block tag

Support extra context vars on include_block via 'with foo=bar'

Support 'only' flag on include_block tag, to omit the parent context

Update StreamField documentation to cover the include_block tag

Rewrite 'BoundBlocks and values' docs based on the include_block tag

Add tests for blocks with legacy render / render_basic methods

Any bits of StreamField infrastructure that attempt to call render or render_basic
on a block with a 'context' kwarg, should (for now) also work on blocks that don't
accept the context kwarg, but output a RemovedInWagtail18Warning.

Explicitly test whether render / render_basic will accept a 'context' kwarg

This avoids unexpected behaviour when the method legitimately accepts a context
kwarg, but happens to throw an unrelated TypeError - in this situation, the final
output (or error diagnostics) will behave as if the context was never passed,
making debugging difficult. See https://github.com/torchbox/wagtail/pull/2786#discussion_r69563984
2016-07-06 17:44:02 +03:00
Matt Westcott
9961455c6a Add formal support for customising the form rendering of StructBlocks
The `form_template` attribute was mentioned in passing in the docs, but was missing various things
to make it fully useful:

- context passed to form_template now includes 'prefix' and 'block_definition'
- context for the form is now populated in a separate overrideable `get_form_context` method
- full documentation and tests for form_template and get_form_context added
2016-07-05 11:48:09 +01:00
Matt Westcott
5758b54f2e Support error_messages dict as argument to RegexBlock
The individual `error_message` kwarg on RegexField is deprecated in Django 1.8
(and removed in Django 1.10), so it's appropriate for RegexBlock to follow the
same convention.
2016-06-28 16:11:52 +01:00
OktayAltay
9358e3b611 Add new FloatBlock, DecimalBlock and a RegexBlock (#2737) 2016-06-23 10:14:28 +01:00
Oktay Altay
31ce2e802c Add new EmailBlock and IntegerBlock 2016-06-17 23:39:49 +01:00
Gagaro
871a5b5d9c Use python_2_unicode_compatible in snippets.rst (#2688)
We should use `python_2_unicode_compatible` in the documentation so that new users know the best practice.
2016-06-07 13:49:28 +01:00
Josh Schneier
6d1a9efbb6 Update documentation and code to put mixin first 2016-05-04 14:05:33 +01:00
Robert Rollins
11793f88c5 Changed indentation on all code samples to 4 spaces.
Most of the samples were already 4-space indented, but a few were using 2-space,
which is both inconsistent and, when it happened with Python code samples,
incompatible with PEP8.
2016-04-28 10:57:22 +01:00
João Luiz Lorencetti
ffbe4730f0 The destination of the ParentalKey should be a subclass of ClusterableModel 2016-04-03 20:18:57 +01:00
Timo Rieber
9bdc843c8f Clarified wagtail userbar options and positioning 2016-03-27 14:23:47 +01:00
Tim Heap
6bd168580e Change Indexed.search_fields to be a listish thing
Indexed.search_fields used to be a tuple. This is incorrect, and it
should have been a list.  Changing it to be a list now would be a
backwards incompatible change, as people do

    search_fields = Page.search_fields + (
        SearchField('body')
    )

Adding a tuple to the end of a list causes an error, so this would
cause all old code that used tuples to throw an error. This is not
great.

A new ThisShouldBeAList class, which subclasses list, has been added.
It additionally allows tuples to be added to it, as in the above
behaviour, but will raise a deprecation warning if someone does this.
Old code that uses tuples will continue to work, but raise a deprecation
warning.

See #2310
2016-03-24 21:05:09 +00:00
Robert Rollins
b94ff6a952 Searchly no longer supports Elasticsearch 1.x, so I switched the suggested development service to Bonsai. 2016-03-10 15:11:42 +00:00
Robert Rollins
6446c42132 Various typo fixes and grammar/clarity improvements. 2016-03-10 15:11:41 +00:00
Loïc Teixeira
33aad3957f Fix internal links with anchors
Generating links with `link text <./path/to/doc#anchor>`__ does not work for html.
It produces a link to `./path/to/doc#anchor` instead of `./path/to/doc.html#anchor`.

It would be tempting to add `.html` before `#` but would likely cause some more issues
when generating the documentation as pdf or epub.

References on the other hand will work regardless of the output format.
2016-03-06 21:05:05 +00:00