-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from cfpb/readme-migrations-tests
Add README, migrations, more tests, better logic
- Loading branch information
Showing
17 changed files
with
383 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ Thumbs.db | |
__pycache__/ | ||
*.py[cod] | ||
.env | ||
.eggs | ||
|
||
# Django # | ||
################# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,7 @@ matrix: | |
python: 3.5 | ||
|
||
install: | ||
pip install tox coveralls | ||
pip install tox | ||
|
||
script: | ||
tox | ||
|
||
after_success: | ||
coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
.. image:: https://travis-ci.org/cfpb/wagtail-inventory.svg?branch=master | ||
:alt: Build Status | ||
:target: https://travis-ci.org/cfpb/wagtail-inventory | ||
|
||
wagtail-inventory | ||
================= | ||
|
||
Search Wagtail pages by block type. | ||
|
||
Wagtail Inventory adds the ability to search pages in your Wagtail site by the StreamField block types they contain. It adds a new Settings menu to the Wagtail admin site that allows you to search for pages that do or do not contain certain blocks. It supports searching both by Wagtail built-in blocks (like ``CharBlock``) as well as any custom blocks you might define. | ||
|
||
Setup | ||
----- | ||
|
||
Install the package using pip: | ||
|
||
.. code-block:: bash | ||
$ pip install wagtail-inventory | ||
Add ``wagtailinventory`` as an installed app in your Django settings: | ||
|
||
.. code-block:: python | ||
# in settings.py | ||
INSTALLED_APPS = ( | ||
... | ||
'wagtailinventory', | ||
... | ||
) | ||
Run migrations to create required database tables: | ||
|
||
.. code-block:: bash | ||
$ manage.py migrate wagtailinventory | ||
Run a management command to initialize database tables with current pages: | ||
|
||
.. code-block:: bash | ||
$ manage.py block_inventory | ||
You should now be able to search your pages in the Wagtail admin site, under Settings > Block Inventory. | ||
|
||
Compatibility | ||
------------- | ||
|
||
This code has been tested for compatibility with: | ||
|
||
* Python 2.7, 3.5, 3.6 | ||
* Django 1.8, 1.11 | ||
* Wagtail 1.8, 1.10, 1.12 | ||
|
||
Testing | ||
------- | ||
|
||
Run unit tests with ``tox`` to test against all supported package combinations. | ||
|
||
Open source licensing info | ||
-------------------------- | ||
|
||
#. `TERMS <https://github.com/cfpb/wagtail-inventory/blob/master/TERMS.md>`_ | ||
#. `LICENSE <https://github.com/cfpb/wagtail-inventory/blob/master/LICENSE>`_ | ||
#. `CFPB Source Code Policy <https://github.com/cfpb/source-code-policy>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,14 @@ | |
|
||
|
||
install_requires = [ | ||
'Django>=1.8,<1.11', | ||
'wagtail>=1.6,<1.9', | ||
'Django>=1.8,<1.12', | ||
'tqdm==4.15.0', | ||
'wagtail>=1.8,<1.13', | ||
] | ||
|
||
|
||
setup_requires = [ | ||
'setuptools-git-version==1.0.3', | ||
] | ||
|
||
|
||
|
@@ -23,10 +29,11 @@ | |
author='CFPB', | ||
author_email='[email protected]', | ||
license='CCO', | ||
version='0.1', | ||
version_format='{tag}.dev{commitcount}+{gitsha}', | ||
include_package_data=True, | ||
packages=find_packages(), | ||
install_requires=install_requires, | ||
setup_requires=setup_requires, | ||
extras_require={ | ||
'testing': testing_extras, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('wagtailcore', '0032_add_bulk_delete_page_permission'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='PageBlock', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('block', models.CharField(db_index=True, max_length=255)), | ||
('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='page_blocks', to='wagtailcore.Page')), | ||
], | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.