Commit graph

8303 commits

Author SHA1 Message Date
Josh Barr
53773424ff added clarification about template tags to tutorial 2015-10-05 22:01:03 +13:00
Tom Dyson
a43d91957d Merge pull request #1779 from takeflight/refactor/document-get-extension
Use os.path.splitext() instead of custom logic in Document.file_extension
2015-10-05 09:43:19 +01:00
Tim Heap
439e4b9a3d Add tests for rendered StreamField output 2015-10-05 14:08:37 +11:00
Tim Heap
86f6287202 Use os.path.splitext() instead of custom logic 2015-10-05 13:26:46 +11:00
Karl Hobley
8bf9851e01 Added docstring on Embed model 2015-10-04 16:27:17 +01:00
Matt Westcott
2534ee6d2d Merge pull request #1773 from torchbox/revert-1768-feature/improve_exception_handling
Revert "Use model specific "DoesNotExist" exception "
2015-10-04 11:48:45 +01:00
Matt Westcott
bfe8cb1ac7 Revert "Use model specific "DoesNotExist" exception " 2015-10-04 11:48:02 +01:00
Ryan Pineo
8a3304c147 Fix page edit publish "View Live" url 2015-10-03 10:27:59 -04:00
Karl Hobley
f1e4a461b7 Cleanup get_serializer_context 2015-10-03 10:59:26 +01:00
Karl Hobley
f37445fcee filter_classes => filter_backends 2015-10-03 10:57:24 +01:00
Karl Hobley
2a2b3a412b Added default get_queryset method to base endpoint 2015-10-03 10:57:24 +01:00
Karl Hobley
67ff876542 Simplified logic for finding which endpoint contains model 2015-10-03 10:57:24 +01:00
Karl Hobley
7dd5467a7c Merge pull request #1766 from annp89/feature/remove_extra_if_statement
Remove redundant if statement
2015-10-03 09:53:32 +01:00
Karl Hobley
6afc3a9ead Merge pull request #1768 from annp89/feature/improve_exception_handling
Use model specific "DoesNotExist" exception
2015-10-03 09:53:11 +01:00
Karl Hobley
e9af76b263 Merge pull request #1769 from annp89/feature/built_in_fn_as_variable_name
Remove use of built in function 'format' as variable name
2015-10-03 09:52:23 +01:00
Ann Paul
1b7a3f045b Refactor try-catch block by limiting code in the try block
Always good to know which line will raise an exception and limit the try block to that statement
2015-10-02 23:17:49 -07:00
Ann Paul
1a51609701 Dont use built-in "format" as variable name since it shadows built-in name 2015-10-02 23:15:13 -07:00
Ann Paul
3b8111f224 Use model specific "DoesNotExist" exception than generic "ObjectDoesNotExist" exception 2015-10-02 22:49:24 -07:00
Ann Paul
17d97c17a1 Remove redundant if statement and refactor checking condition 2015-10-02 09:27:39 -07:00
Tim Heap
f6fb743a18 Add __html__ method to StreamValues
This allows template authors to write `{{ page.stream_field }}` in
Jinja2 templates without having to jump through HTML escaping loops.
2015-10-02 08:27:24 +10:00
Tim Heap
21d290af12 Add references to Django documentation on configuring Jinja 2015-10-02 08:06:28 +10:00
Karl Hobley
e955f7da4c Merge pull request #1761 from kaedroho/fix-search-suggestions
Fix search suggestions
2015-10-01 17:23:02 +01:00
Karl Hobley
99289a2849 Fix search suggestions 2015-10-01 12:45:25 +01:00
Tim Heap
cf7aaae09c Add tests for Jinja template tags 2015-10-01 20:04:06 +10:00
Tim Heap
e225481f2f Add documentation for using Jinja2 2015-10-01 16:00:40 +10:00
Tim Heap
02e4288b15 Add wagtailuserbar() Jinja function 2015-10-01 14:59:13 +10:00
Matt Westcott
dbb6fe73ad Merge branch 'master' of https://github.com/torchbox/wagtail 2015-09-30 17:16:56 +01:00
Matt Westcott
a02cc3e67c Release note for #1744 2015-09-30 17:16:48 +01:00
Tom Dyson
e162730acb Merge pull request #1759 from gasman/doc/developer-setup
Rewrite developer setup docs
2015-09-30 16:59:43 +01:00
Matt Westcott
5a67971d1d Merge branch 'refactor/jinja-support' of https://github.com/takeflight/wagtail 2015-09-30 16:48:21 +01:00
Matt Westcott
1afc5ba0f1 Transferred vagrant-wagtail-develop repo to torchbox 2015-09-30 16:24:42 +01:00
Matt Westcott
377db9e878 Rewrite developer setup docs
* State the requirement for Node.js up-front (since it's required by everyone, not just front-end devs)
* Point to vagrant-wagtail-develop instead of making people set up a Vagrant instance manually
* No need to fiddle with python paths via local.py - 'setup.py develop' handles that
* Skip instructions for virtualenvs (anyone who decides against the Vagrant route is expected to know how to use them)
2015-09-30 15:54:08 +01:00
Tim Heap
de88f90b36 Add rudimentary Jinja2 template tag support
The following tags and filters are supported:

* `wagtailcore`:
  * `pageurl()`
  * `slugurl()`
  * `wagtail_version()`
  * `|pageurl`
* `wagtailimages`:
  * `image()`

Django template tags have been translated to Jinja functions, rather
than custom tags. Functions are easier to use compared to template tags,
and can be composed and combined for greater flexibility.

The template tag libraries have been grouped as Jinja Extensions, which
are loadable via the `extensions` option. An example Django Jinja2
configuration is:

```python
TEMPLATES = [
    # ...
    {
        'BACKEND': 'django.template.backends.jinja2.Jinja2',
        'APP_DIRS': True,
        'OPTIONS': {
            'extensions': [
                'wagtail.wagtailcore.templatetags.jinja2.core',
                'wagtail.wagtailimages.templatetags.jinja2.images',
            ],
        },
    },
]
```
2015-09-30 18:50:57 +10:00
Karl Hobley
7de03ef8c4 Merge pull request #1739 from JoshBarr/docs/sitemap-clarification
Added section on hostnames to Sitemaps docs
2015-09-28 13:25:29 +01:00
Tim Heap
8aa5bdfddf Check both page and self in templatetag contexts
Old code that does not properly extend `Page.get_context()` for context
generation will not get the new `PAGE_TEMPLATE_VAR` in their contexts,
which did not play nicely with the `wagtailuserbar`. Now, the template
context is checked for both `PAGE_TEMPLATE_VAR` and `self`, in that
order, for a Page.
2015-09-28 11:00:56 +10:00
Petr Vacha
68393240da Added assertNotContains multipart for SimplePage. 2015-09-28 01:36:45 +02:00
Petr Vacha
4fd725ffa9 Added tests for multipart forms. 2015-09-28 01:25:59 +02:00
Petr Vacha
a61327c92c Set enctype as multipart if form.is_multipart returns true. 2015-09-27 10:37:21 +02:00
Josh Barr
221a3e5254 added docs about hostnames 2015-09-27 01:41:52 +12:00
Karl Hobley
97eaa045fd Merge pull request #1728 from alexgleason/docs-fix-link-deploy-vagrant-sh
Removed broken link to non-existent vagrant install script
2015-09-23 21:02:08 +01:00
Alex Gleason
6fc2dd4904 Removed broken link to non-existent vagrant install script 2015-09-23 14:51:43 -05:00
Matt Westcott
99b99f28d4 Use lru_cache and 'with open' to clean up code 2015-09-23 10:11:52 +01:00
Karl Hobley
ebd01fd1b4 Merge pull request #1719 from nimasmi/custom-queryset-docs
Document custom queryset required approach
2015-09-23 09:52:43 +01:00
Karl Hobley
c224002d3e verbose_name should be lowercase 2015-09-23 09:52:26 +01:00
Nick Smith
536c8cd203 Fix typo 2015-09-23 09:42:50 +01:00
Nick Smith
dea22d8fe0 Document custom queryset required approach 2015-09-23 09:31:35 +01:00
Matt Westcott
8a98b5ab8c suppress PEP8 warning from unused import 2015-09-23 02:35:38 +01:00
Matt Westcott
1a743366fb Cache the results of has_jpeg_support and has_png_support
This means we can use them on the admin dashboard without performing redundant file/image operations.
2015-09-23 02:29:18 +01:00
Matt Westcott
a311955534 Add system check for libjpeg / zlib 2015-09-23 01:34:08 +01:00
Matt Westcott
16020af213 Loudly highlight the fact that libjpeg and zlib are required 2015-09-22 22:54:47 +01:00