diff --git a/examples/wagtaildemo/Procfile b/examples/wagtaildemo/Procfile new file mode 100644 index 00000000..9f804e6f --- /dev/null +++ b/examples/wagtaildemo/Procfile @@ -0,0 +1 @@ +web: uwsgi --http :$PORT --module wagtaildemo.heroku_wsgi --master --processes 2 --static-map /media/=/app/media/ --offload-threads 1 diff --git a/examples/wagtaildemo/README.md b/examples/wagtaildemo/README.md index 051cbd46..927a9898 100644 --- a/examples/wagtaildemo/README.md +++ b/examples/wagtaildemo/README.md @@ -1,16 +1,22 @@ -Wagtail demo +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/torchbox/wagtaildemo) + +Wagtail demo project ======================= -[Wagtail](http://wagtail.io) is distributed as a Python package, to be incorporated into a Django project via the INSTALLED_APPS setting. To get you up and running quickly, we provide a demo site with all the configuration in place, including a set of example page types. +This is a demonstration project for [Wagtail CMS](http://wagtail.io). -Setup (with Vagrant - recommended) ------ +*We do __not__ recommend using this project to start your own site*. This project is only to provide some examples of implementing common features, it is not an exemplar of Django or Wagtail best practice. -We recommend running Wagtail in a virtual machine using Vagrant, as this ensures that the correct dependencies are in place regardless of how your host machine is set up. +If you're reasonably new to Python/Django, we suggest you run this project on a Virtual Machine using Vagrant, which helps resolve common software dependency issues. However for more experienced developers, instructions to start this project without Vagrant follow below. + +Once you're familiar with the examples in this project and you want to start a real site, we strongly recommend running the ``wagtail start`` command in a fresh virtual environment, explained in the [Wagtail CMS Documentation](http://wagtail.readthedocs.org/en/latest/getting_started/). + +Setup with Vagrant +------------------ ### Dependencies * [VirtualBox](https://www.virtualbox.org/) -* [Vagrant 1.1+](http://www.vagrantup.com) +* [Vagrant 1.5+](http://www.vagrantup.com) ### Installation Run the following commands: @@ -20,25 +26,11 @@ Run the following commands: vagrant up vagrant ssh (then, within the SSH session:) - ./manage.py createsuperuser ./manage.py runserver 0.0.0.0:8000 -This will make the app accessible on the host machine as http://localhost:8111/ - you can access the Wagtail admin interface at http://localhost:8111/admin/ . The codebase is located on the host -machine, exported to the VM as a shared folder; code editing and Git operations will generally be done on the host. +The demo site will now be accessible at [http://localhost:8000/](http://localhost:8000/) and the Wagtail admin interface at [http://localhost:8000/admin/](http://localhost:8000/admin/) . Log into the admin with the credentials ``admin / changeme``. -### Developing Wagtail -The above setup is all you need for trying out the demo site and building Wagtail-powered sites. To develop Wagtail itself, you'll need a working copy of [the Wagtail codebase](https://github.com/torchbox/wagtail) alongside your demo site, shared with your VM so that it is picked up instead of the packaged copy of Wagtail. From the location where you cloned wagtaildemo: - - git clone https://github.com/torchbox/wagtail.git - cd wagtaildemo - cp Vagrantfile.local.example Vagrantfile.local - (edit Vagrantfile.local to specify the path to the wagtail codebase, if required) - cp wagtaildemo/settings/local.py.example wagtaildemo/settings/local.py - (uncomment the lines from 'import sys' onward, and edit the rest of local.py as appropriate) - -If your VM is currently running, you'll then need to run `vagrant halt` followed by `vagrant up` for the changes to take effect. - -Setup (without Vagrant) +Setup without Vagrant ----- Don't want to set up a whole VM to try out Wagtail? No problem. @@ -52,15 +44,13 @@ With PostgreSQL running (and configured to allow you to connect as the 'postgres git clone https://github.com/torchbox/wagtaildemo.git cd wagtaildemo - pip install -r requirements/dev.txt + pip install -r requirements.txt createdb -Upostgres wagtaildemo - ./manage.py syncdb ./manage.py migrate + ./manage.py load_initial_data ./manage.py createsuperuser ./manage.py runserver ### SQLite support -SQLite is supported as an alternative to PostgreSQL - update the DATABASES setting -in wagtaildemo/settings/base.py to use 'django.db.backends.sqlite3', as you would -with a regular Django project. +SQLite is supported as an alternative to PostgreSQL. Before running the `pip install -r requirements.txt` step above, delete the `psycopg2` line in requirements.txt; then, in wagtaildemo/settings/base.py, update the `DATABASES` setting to use `'django.db.backends.sqlite3'` and set `NAME` to be the full path of your database file, as you would with a regular Django project. diff --git a/examples/wagtaildemo/Vagrantfile b/examples/wagtaildemo/Vagrantfile index 71342a8a..b0792ccb 100644 --- a/examples/wagtaildemo/Vagrantfile +++ b/examples/wagtaildemo/Vagrantfile @@ -1,46 +1,85 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant::Config.run do |config| +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure(2) do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. - # Base box to build off, and download URL for when it doesn't exist on the user's system already - config.vm.box = "wagtail-base-v0.3" - config.vm.box_url = "http://downloads.torchbox.com/wagtail-base-v0.3.box" + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + config.vm.box = "torchbox/wagtail" + config.vm.box_version = "~> 1.0" - # You can also build from a vanilla precise32 box, although it'll take longer - # config.vm.box = "precise32" - # config.vm.box_url = "http://files.vagrantup.com/precise32.box" + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false - # As an alternative to precise32, VMs can be built from the 'django-base' box as defined at - # https://github.com/torchbox/vagrant-django-base , which has more of the necessary server config - # baked in and thus takes less time to initialise. To go down this route, you will need to build - # and host django-base.box yourself, and substitute your own URL below. - #config.vm.box = "django-base-v2.1" - #config.vm.box_url = "http://vmimages.torchbox.com/django-base-v2.1.box" # Torchbox-internal URL to django-base.box - - # Boot with a GUI so you can see the screen. (Default is headless) - # config.vm.boot_mode = :gui - - # Assign this VM to a host only network IP, allowing you to access it - # via the IP. - # config.vm.network "33.33.33.10" - - # Forward a port from the guest to the host, which allows for outside - # computers to access the VM, whereas host only networking does not. - config.vm.forward_port 8000, 8111 - - # Share an additional folder to the guest VM. The first argument is - # an identifier, the second is the path on the guest to mount the - # folder, and the third is the path on the host to the actual folder. - config.vm.share_folder "project", "/home/vagrant/wagtaildemo", "." - - # Enable provisioning with a shell script. - config.vm.provision :shell, :path => "etc/install/install.sh", :args => "wagtaildemo" + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8000" will access port 8000 on the guest machine. + config.vm.network "forwarded_port", guest: 8000, host: 8000 - # If a 'Vagrantfile.local' file exists, import any configuration settings - # defined there into here. Vagrantfile.local is ignored in version control, - # so this can be used to add configuration specific to this computer. - if File.exist? "Vagrantfile.local" - instance_eval File.read("Vagrantfile.local"), "Vagrantfile.local" - end + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + config.vm.synced_folder ".", "/home/vagrant/wagtaildemo" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + # config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + # vb.memory = "1024" + # end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # sudo apt-get update + # sudo apt-get install -y apache2 + # SHELL + config.vm.provision :shell, :path => "vagrant/provision.sh" + + # Enable agent forwarding over SSH connections. + config.ssh.forward_agent = true + + # If a 'Vagrantfile.local' file exists, import any configuration settings + # defined there into here. Vagrantfile.local is ignored in version control, + # so this can be used to add configuration specific to this computer. + if File.exist? "Vagrantfile.local" + instance_eval File.read("Vagrantfile.local"), "Vagrantfile.local" + end end diff --git a/examples/wagtaildemo/Vagrantfile.local.example b/examples/wagtaildemo/Vagrantfile.local.example index 99eaff9d..6366f9a1 100644 --- a/examples/wagtaildemo/Vagrantfile.local.example +++ b/examples/wagtaildemo/Vagrantfile.local.example @@ -11,8 +11,9 @@ # Clone https://github.com/torchbox/wagtail somewhere convenient, and replace # "../wagtail" below with the correct path: -config.vm.share_folder "wagtail", "/home/vagrant/wagtail", "../wagtail" +config.vm.synced_folder "../wagtail", "/home/vagrant/wagtail" -# You'll also need to tweak the Python path so that it picks up this instance of -# Wagtail rather than the packaged one - see wagtaildemo/settings/local.py.example. +# You'll also need to configure your Python environment within the VM to pick up this +# instance of Wagtail rather than the packaged one; usually this is done by running +# `./setup.py develop` within the checked-out Wagtail codebase. diff --git a/examples/wagtaildemo/app.json b/examples/wagtaildemo/app.json new file mode 100644 index 00000000..e4ceb028 --- /dev/null +++ b/examples/wagtaildemo/app.json @@ -0,0 +1,16 @@ +{ + "name": "Wagtaildemo", + "description": "Wagtaildemo", + "repository": "https://github.com/torchbox/wagtaildemo", + "logo": "http://wagtail.io/static/wagtailsite/images/navlogo2.png", + "keywords": ["wagtail", "django"], + "env": { + "DJANGO_SETTINGS_MODULE": "wagtaildemo.settings.heroku" + }, + "scripts": { + "postdeploy": "django-admin.py migrate && django-admin.py load_initial_data && echo 'from wagtail.wagtailimages.models import Rendition; Rendition.objects.all().delete()' | django-admin.py shell" + }, + "addons": [ + "heroku-postgresql:hobby-dev" + ] +} diff --git a/examples/wagtaildemo/bin/post_compile b/examples/wagtaildemo/bin/post_compile new file mode 100644 index 00000000..366847d7 --- /dev/null +++ b/examples/wagtaildemo/bin/post_compile @@ -0,0 +1,8 @@ +# Copy image files into media folder +mkdir -p media/original_images +cp demo/fixtures/images/* media/original_images/ + +# dj shortcut +if ! command -v dj; then + ln -s /app/.heroku/python/bin/django-admin /app/.heroku/python/bin/dj +fi diff --git a/examples/wagtaildemo/demo/fixtures/demo.json b/examples/wagtaildemo/demo/fixtures/demo.json index 86732b8a..4fe0d79d 100644 --- a/examples/wagtaildemo/demo/fixtures/demo.json +++ b/examples/wagtaildemo/demo/fixtures/demo.json @@ -592,6 +592,15 @@ "page": 17 } }, +{ + "pk": 2, + "model": "demo.advert", + "fields": { + "url": "", + "text": "Contact", + "page": 12 + } +}, { "pk": 5, "model": "demo.blogindexpage", @@ -615,7 +624,7 @@ "pk": 16, "model": "demo.blogpage", "fields": { - "body": "

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.


mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

", + "body": "[{\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"paragraph\", \"value\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

Also, there is another superspecies in sub-Saharan Africa

\", \"image\": 13, \"alignment\": \"left\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"paragraph\", \"value\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia

\", \"image\": 15, \"alignment\": \"right\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

The remaining five species are highly variable morphologically

\", \"image\": 14, \"alignment\": \"full\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"pullquote\", \"value\": {\"quote\": \"There is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band\", \"attribution\": \"Wikipedia\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}]", "date": "2013-12-02", "feed_image": 7 } @@ -624,7 +633,7 @@ "pk": 18, "model": "demo.blogpage", "fields": { - "body": "

Wagtails are slender, often colourful, ground-feeding insectivores of open country in the Old World. They are ground nesters, laying up to six speckled eggs at a time. Among their most conspicuous behaviours is a near constant tail wagging, a trait that has given the birds their common name. In spite of the ubiquity of the behaviour and observations of it, the reasons for it are poorly understood. It has been suggested that it may flush up prey, or that it may signal submissiveness to other wagtails. Recent studies have suggested instead that it is a signal of vigilance that may aid to deter potential predators.




At first glance, the wagtails appear to be divided into a yellow-bellied group and a white-bellied one, or one where the upper head is black and another where it is usually gray, but may be olive, yellow, or other colours. However, these are not evolutionary lineages; change of belly colour and increase of melanin have occurred independently several times in the wagtails, and the colour patterns which actually indicate relationships are more subtle.


mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.


The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.


Three species are poly- or paraphyletic in the present taxonomical arrangement and either subspecies need to be reassigned and/or species split up. The Blue-headed Wagtail (AKA Yellow Wagtail and many other names), especially, has always been a taxonomical nightmare with over a dozen currently accepted subspecies and many more invalid ones. The two remaining \"monochrome\" species, Mekong and African Pied Wagtail may be closely related, or a most striking example of convergent evolution.


Prehistoric wagtails known from fossils are Motacilla humata and Motacilla major.


See the species accounts for more on individual species' relationships.

", + "body": "[{\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"paragraph\", \"value\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

Also, there is another superspecies in sub-Saharan Africa

\", \"image\": 13, \"alignment\": \"left\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"paragraph\", \"value\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia

\", \"image\": 15, \"alignment\": \"right\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

The remaining five species are highly variable morphologically

\", \"image\": 14, \"alignment\": \"full\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"pullquote\", \"value\": {\"quote\": \"There is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band\", \"attribution\": \"Wikipedia\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}]", "date": "2014-01-10", "feed_image": 15 } @@ -633,7 +642,7 @@ "pk": 19, "model": "demo.blogpage", "fields": { - "body": "

Wagtails are slender, often colourful, ground-feeding insectivores of open country in the Old World. They are ground nesters, laying up to six speckled eggs at a time. Among their most conspicuous behaviours is a near constant tail wagging, a trait that has given the birds their common name. In spite of the ubiquity of the behaviour and observations of it, the reasons for it are poorly understood. It has been suggested that it may flush up prey, or that it may signal submissiveness to other wagtails. Recent studies have suggested instead that it is a signal of vigilance that may aid to deter potential predators.


At first glance, the wagtails appear to be divided into a yellow-bellied group and a white-bellied one, or one where the upper head is black and another where it is usually gray, but may be olive, yellow, or other colours. However, these are not evolutionary lineages; change of belly colour and increase of melanin have occurred independently several times in the wagtails, and the colour patterns which actually indicate relationships are more subtle.


mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.


The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.


Three species are poly- or paraphyletic in the present taxonomical arrangement and either subspecies need to be reassigned and/or species split up. The Blue-headed Wagtail (AKA Yellow Wagtail and many other names), especially, has always been a taxonomical nightmare with over a dozen currently accepted subspecies and many more invalid ones. The two remaining \"monochrome\" species, Mekong and African Pied Wagtail may be closely related, or a most striking example of convergent evolution.


Prehistoric wagtails known from fossils are Motacilla humata and Motacilla major.


See the species accounts for more on individual species' relationships.

", + "body": "[{\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"paragraph\", \"value\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

Also, there is another superspecies in sub-Saharan Africa

\", \"image\": 13, \"alignment\": \"left\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"paragraph\", \"value\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia. Wagtails spread rapidly across Eurasia and dispersed to Africa in the Zanclean (Early Pliocene) where the sub-Saharan lineage was later isolated. The African Pied Wagtail (and possibly the Mekong Wagtail) diverged prior to the massive radiation of the white-bellied black-throated and most yellow-bellied forms, all of which took place during the late Piacenzian (early Late Pliocene), c. 3 mya.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

The origin of the genus appears to be in the general area of Eastern Siberia/Mongolia

\", \"image\": 15, \"alignment\": \"right\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"aligned_image\", \"value\": {\"caption\": \"

The remaining five species are highly variable morphologically

\", \"image\": 14, \"alignment\": \"full\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}, {\"type\": \"pullquote\", \"value\": {\"quote\": \"There is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band\", \"attribution\": \"Wikipedia\"}}, {\"type\": \"paragraph\", \"value\": \"

mtDNA cytochrome b and NADH dehydrogenase subunit 2 sequence data (Voelker, 2002) is of limited use: the suspicion that there is a superspecies of probably 3 white-bellied, black-throated wagtails is confirmed. Also, there is another superspecies in sub-Saharan Africa, three white-throated species with a black breast-band. The remaining five species are highly variable morphologically and their relationships with each other and with the two clades have not yet been satisfactorily explained.

\"}]", "date": "2014-02-01", "feed_image": 14 } @@ -784,7 +793,7 @@ "pk": 2, "model": "demo.homepage", "fields": { - "body": "

Wagtails are slender, often colourful, ground-feeding insectivores of open country in the Old World. They are ground nesters, laying up to six speckled eggs at a time. Among their most conspicuous behaviours is a near constant tail wagging, a trait that has given the birds their common name. In spite of the ubiquity of the behaviour and observations of it, the reasons for it are poorly understood. It has been suggested that it may flush up prey, or that it may signal submissiveness to other wagtails. Recent studies have suggested instead that it is a signal of vigilance that may aid to deter potential predators.

" + "body": "[{\"type\": \"intro\", \"value\": \"

Wagtails are slender, often colourful, ground-feeding insectivores of open country in the Old World.\\u00a0

\"}, {\"type\": \"paragraph\", \"value\": \"

They are ground nesters, laying up to six speckled eggs at a time. Among their most conspicuous behaviours is a near constant tail wagging, a trait that has given the birds their common name.\\u00a0

\"}, {\"type\": \"paragraph\", \"value\": \"

In spite of the ubiquity of the behaviour and observations of it, the reasons for it are poorly understood. It has been suggested that it may flush up prey, or that it may signal submissiveness to other wagtails. Recent studies have suggested instead that it is a signal of vigilance that may aid to deter potential predators.

\"}]" } }, { @@ -1035,5 +1044,23 @@ "name": "writer", "slug": "writer" } +}, +{ + "fields": { + "email": "", + "username": "admin", + "last_name": "", + "last_login": "2015-01-15T10:15:46.942Z", + "is_superuser": true, + "is_active": true, + "groups": [], + "date_joined": "2015-01-15T10:13:48.969Z", + "is_staff": true, + "user_permissions": [], + "first_name": "", + "password": "pbkdf2_sha256$15000$hbmFjDx3rL12$lfU7j6YuVlKmUPChuiSXsXFhIgrejJGuWvWj5wxlRjQ=" + }, + "model": "auth.user", + "pk": 1 } ] diff --git a/examples/wagtaildemo/demo/management/__init__.py b/examples/wagtaildemo/demo/management/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/examples/wagtaildemo/demo/management/commands/__init__.py b/examples/wagtaildemo/demo/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/examples/wagtaildemo/demo/management/commands/load_initial_data.py b/examples/wagtaildemo/demo/management/commands/load_initial_data.py new file mode 100644 index 00000000..704702bf --- /dev/null +++ b/examples/wagtaildemo/demo/management/commands/load_initial_data.py @@ -0,0 +1,21 @@ +import os, shutil + +from django.conf import settings +from django.core.management.base import BaseCommand +from django.core.management import call_command + + +class Command(BaseCommand): + def handle(self, **options): + fixtures_dir = os.path.join(settings.PROJECT_ROOT, 'demo', 'fixtures') + fixture_file = os.path.join(fixtures_dir, 'demo.json') + image_src_dir = os.path.join(fixtures_dir, 'images') + image_dest_dir = os.path.join(settings.MEDIA_ROOT, 'original_images') + + call_command('loaddata', fixture_file, verbosity=0) + + if not os.path.isdir(image_dest_dir): + os.makedirs(image_dest_dir) + + for filename in os.listdir(image_src_dir): + shutil.copy(os.path.join(image_src_dir, filename), image_dest_dir) diff --git a/examples/wagtaildemo/demo/migrations/0001_initial.py b/examples/wagtaildemo/demo/migrations/0001_initial.py index 1138cf9e..cfd7b7e7 100644 --- a/examples/wagtaildemo/demo/migrations/0001_initial.py +++ b/examples/wagtaildemo/demo/migrations/0001_initial.py @@ -1,695 +1,585 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +import modelcluster.fields +import wagtail.wagtailcore.fields +import modelcluster.tags -class Migration(SchemaMigration): +class Migration(migrations.Migration): - def forwards(self, orm): - # Adding model 'AdvertPlacement' - db.create_table(u'demo_advertplacement', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='advert_placements', to=orm['wagtailcore.Page'])), - ('advert', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['demo.Advert'])), - )) - db.send_create_signal(u'demo', ['AdvertPlacement']) + dependencies = [ + ('wagtailimages', '0002_initial_data'), + ('wagtaildocs', '0002_initial_data'), + ('wagtailcore', '0002_initial_data'), + ('taggit', '0001_initial'), + ] - # Adding model 'Advert' - db.create_table(u'demo_advert', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='adverts', null=True, to=orm['wagtailcore.Page'])), - ('url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), - ('text', self.gf('django.db.models.fields.CharField')(max_length=255)), - )) - db.send_create_signal(u'demo', ['Advert']) - - # Adding model 'HomePageCarouselItem' - db.create_table(u'demo_homepagecarouselitem', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - ('embed_url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('caption', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='carousel_items', to=orm['demo.HomePage'])), - )) - db.send_create_signal(u'demo', ['HomePageCarouselItem']) - - # Adding model 'HomePageRelatedLink' - db.create_table(u'demo_homepagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.HomePage'])), - )) - db.send_create_signal(u'demo', ['HomePageRelatedLink']) - - # Adding model 'HomePage' - db.create_table(u'demo_homepage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('body', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - )) - db.send_create_signal(u'demo', ['HomePage']) - - # Adding model 'StandardIndexPageRelatedLink' - db.create_table(u'demo_standardindexpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.StandardIndexPage'])), - )) - db.send_create_signal(u'demo', ['StandardIndexPageRelatedLink']) - - # Adding model 'StandardIndexPage' - db.create_table(u'demo_standardindexpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('intro', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('feed_image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['StandardIndexPage']) - - # Adding model 'StandardPageCarouselItem' - db.create_table(u'demo_standardpagecarouselitem', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - ('embed_url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('caption', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='carousel_items', to=orm['demo.StandardPage'])), - )) - db.send_create_signal(u'demo', ['StandardPageCarouselItem']) - - # Adding model 'StandardPageRelatedLink' - db.create_table(u'demo_standardpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.StandardPage'])), - )) - db.send_create_signal(u'demo', ['StandardPageRelatedLink']) - - # Adding model 'StandardPage' - db.create_table(u'demo_standardpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('intro', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('body', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('feed_image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['StandardPage']) - - # Adding model 'BlogIndexPageRelatedLink' - db.create_table(u'demo_blogindexpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.BlogIndexPage'])), - )) - db.send_create_signal(u'demo', ['BlogIndexPageRelatedLink']) - - # Adding model 'BlogIndexPage' - db.create_table(u'demo_blogindexpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('intro', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - )) - db.send_create_signal(u'demo', ['BlogIndexPage']) - - # Adding model 'BlogPageCarouselItem' - db.create_table(u'demo_blogpagecarouselitem', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - ('embed_url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('caption', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='carousel_items', to=orm['demo.BlogPage'])), - )) - db.send_create_signal(u'demo', ['BlogPageCarouselItem']) - - # Adding model 'BlogPageRelatedLink' - db.create_table(u'demo_blogpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.BlogPage'])), - )) - db.send_create_signal(u'demo', ['BlogPageRelatedLink']) - - # Adding model 'BlogPageTag' - db.create_table(u'demo_blogpagetag', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('tag', self.gf('django.db.models.fields.related.ForeignKey')(related_name=u'demo_blogpagetag_items', to=orm['taggit.Tag'])), - ('content_object', self.gf('modelcluster.fields.ParentalKey')(related_name='tagged_items', to=orm['demo.BlogPage'])), - )) - db.send_create_signal(u'demo', ['BlogPageTag']) - - # Adding model 'BlogPage' - db.create_table(u'demo_blogpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('body', self.gf('wagtail.wagtailcore.fields.RichTextField')()), - ('date', self.gf('django.db.models.fields.DateField')()), - ('feed_image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['BlogPage']) - - # Adding model 'PersonPageRelatedLink' - db.create_table(u'demo_personpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.PersonPage'])), - )) - db.send_create_signal(u'demo', ['PersonPageRelatedLink']) - - # Adding model 'PersonPage' - db.create_table(u'demo_personpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('telephone', self.gf('django.db.models.fields.CharField')(max_length=20, blank=True)), - ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)), - ('address_1', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('address_2', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('city', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('country', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('post_code', self.gf('django.db.models.fields.CharField')(max_length=10, blank=True)), - ('first_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('last_name', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('intro', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('biography', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - ('feed_image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['PersonPage']) - - # Adding model 'ContactPage' - db.create_table(u'demo_contactpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('telephone', self.gf('django.db.models.fields.CharField')(max_length=20, blank=True)), - ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)), - ('address_1', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('address_2', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('city', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('country', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('post_code', self.gf('django.db.models.fields.CharField')(max_length=10, blank=True)), - ('body', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('feed_image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['ContactPage']) - - # Adding model 'EventIndexPageRelatedLink' - db.create_table(u'demo_eventindexpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.EventIndexPage'])), - )) - db.send_create_signal(u'demo', ['EventIndexPageRelatedLink']) - - # Adding model 'EventIndexPage' - db.create_table(u'demo_eventindexpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('intro', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - )) - db.send_create_signal(u'demo', ['EventIndexPage']) - - # Adding model 'EventPageCarouselItem' - db.create_table(u'demo_eventpagecarouselitem', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - ('embed_url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('caption', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='carousel_items', to=orm['demo.EventPage'])), - )) - db.send_create_signal(u'demo', ['EventPageCarouselItem']) - - # Adding model 'EventPageRelatedLink' - db.create_table(u'demo_eventpagerelatedlink', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='related_links', to=orm['demo.EventPage'])), - )) - db.send_create_signal(u'demo', ['EventPageRelatedLink']) - - # Adding model 'EventPageSpeaker' - db.create_table(u'demo_eventpagespeaker', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('link_external', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('link_page', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtailcore.Page'])), - ('link_document', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['wagtaildocs.Document'])), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='speakers', to=orm['demo.EventPage'])), - ('first_name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('last_name', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['EventPageSpeaker']) - - # Adding model 'EventPage' - db.create_table(u'demo_eventpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('date_from', self.gf('django.db.models.fields.DateField')()), - ('date_to', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), - ('time_from', self.gf('django.db.models.fields.TimeField')(null=True, blank=True)), - ('time_to', self.gf('django.db.models.fields.TimeField')(null=True, blank=True)), - ('audience', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('location', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('body', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('cost', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('signup_link', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('feed_image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, on_delete=models.SET_NULL, to=orm['wagtailimages.Image'])), - )) - db.send_create_signal(u'demo', ['EventPage']) - - - def backwards(self, orm): - # Deleting model 'AdvertPlacement' - db.delete_table(u'demo_advertplacement') - - # Deleting model 'Advert' - db.delete_table(u'demo_advert') - - # Deleting model 'HomePageCarouselItem' - db.delete_table(u'demo_homepagecarouselitem') - - # Deleting model 'HomePageRelatedLink' - db.delete_table(u'demo_homepagerelatedlink') - - # Deleting model 'HomePage' - db.delete_table(u'demo_homepage') - - # Deleting model 'StandardIndexPageRelatedLink' - db.delete_table(u'demo_standardindexpagerelatedlink') - - # Deleting model 'StandardIndexPage' - db.delete_table(u'demo_standardindexpage') - - # Deleting model 'StandardPageCarouselItem' - db.delete_table(u'demo_standardpagecarouselitem') - - # Deleting model 'StandardPageRelatedLink' - db.delete_table(u'demo_standardpagerelatedlink') - - # Deleting model 'StandardPage' - db.delete_table(u'demo_standardpage') - - # Deleting model 'BlogIndexPageRelatedLink' - db.delete_table(u'demo_blogindexpagerelatedlink') - - # Deleting model 'BlogIndexPage' - db.delete_table(u'demo_blogindexpage') - - # Deleting model 'BlogPageCarouselItem' - db.delete_table(u'demo_blogpagecarouselitem') - - # Deleting model 'BlogPageRelatedLink' - db.delete_table(u'demo_blogpagerelatedlink') - - # Deleting model 'BlogPageTag' - db.delete_table(u'demo_blogpagetag') - - # Deleting model 'BlogPage' - db.delete_table(u'demo_blogpage') - - # Deleting model 'PersonPageRelatedLink' - db.delete_table(u'demo_personpagerelatedlink') - - # Deleting model 'PersonPage' - db.delete_table(u'demo_personpage') - - # Deleting model 'ContactPage' - db.delete_table(u'demo_contactpage') - - # Deleting model 'EventIndexPageRelatedLink' - db.delete_table(u'demo_eventindexpagerelatedlink') - - # Deleting model 'EventIndexPage' - db.delete_table(u'demo_eventindexpage') - - # Deleting model 'EventPageCarouselItem' - db.delete_table(u'demo_eventpagecarouselitem') - - # Deleting model 'EventPageRelatedLink' - db.delete_table(u'demo_eventpagerelatedlink') - - # Deleting model 'EventPageSpeaker' - db.delete_table(u'demo_eventpagespeaker') - - # Deleting model 'EventPage' - db.delete_table(u'demo_eventpage') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'demo.advert': { - 'Meta': {'object_name': 'Advert'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adverts'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'demo.advertplacement': { - 'Meta': {'object_name': 'AdvertPlacement'}, - 'advert': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': u"orm['demo.Advert']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'advert_placements'", 'to': u"orm['wagtailcore.Page']"}) - }, - u'demo.blogindexpage': { - 'Meta': {'object_name': 'BlogIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpage': { - 'Meta': {'object_name': 'BlogPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.blogpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpagetag': { - 'Meta': {'object_name': 'BlogPageTag'}, - 'content_object': ('modelcluster.fields.ParentalKey', [], {'related_name': "'tagged_items'", 'to': u"orm['demo.BlogPage']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'demo_blogpagetag_items'", 'to': u"orm['taggit.Tag']"}) - }, - u'demo.contactpage': { - 'Meta': {'object_name': 'ContactPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.eventindexpage': { - 'Meta': {'object_name': 'EventIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.eventindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpage': { - 'Meta': {'object_name': 'EventPage', '_ormbases': [u'wagtailcore.Page']}, - 'audience': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'cost': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'date_from': ('django.db.models.fields.DateField', [], {}), - 'date_to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'signup_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'time_from': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}), - 'time_to': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpagespeaker': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageSpeaker'}, - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'speakers'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepage': { - 'Meta': {'object_name': 'HomePage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.homepagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.personpage': { - 'Meta': {'object_name': 'PersonPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'biography': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.personpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'PersonPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.PersonPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardindexpage': { - 'Meta': {'object_name': 'StandardIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardpage': { - 'Meta': {'object_name': 'StandardPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.standardpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'taggit.tag': { - 'Meta': {'object_name': 'Tag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) - }, - u'wagtailcore.page': { - 'Meta': {'object_name': 'Page'}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pages'", 'to': u"orm['contenttypes.ContentType']"}), - 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'has_unpublished_changes': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'live': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_pages'", 'null': 'True', 'to': u"orm['auth.User']"}), - 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'search_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'seo_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'show_in_menus': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}) - }, - u'wagtaildocs.document': { - 'Meta': {'object_name': 'Document'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) - }, - u'wagtailimages.image': { - 'Meta': {'object_name': 'Image'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'height': ('django.db.models.fields.IntegerField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'width': ('django.db.models.fields.IntegerField', [], {}) - } - } - - complete_apps = ['demo'] \ No newline at end of file + operations = [ + migrations.CreateModel( + name='Advert', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('url', models.URLField(null=True, blank=True)), + ('text', models.CharField(max_length=255)), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='AdvertPlacement', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('advert', models.ForeignKey(related_name=b'+', to='demo.Advert')), + ], + options={ + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BlogIndexPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BlogIndexPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BlogPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('body', wagtail.wagtailcore.fields.RichTextField()), + ('date', models.DateField(verbose_name=b'Post date')), + ('feed_image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='BlogPageCarouselItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), + ('caption', models.CharField(max_length=255, blank=True)), + ('image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BlogPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BlogPageTag', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('content_object', modelcluster.fields.ParentalKey(related_name=b'tagged_items', to='demo.BlogPage')), + ('tag', models.ForeignKey(related_name='demo_blogpagetag_items', to='taggit.Tag')), + ], + options={ + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='ContactPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('telephone', models.CharField(max_length=20, blank=True)), + ('email', models.EmailField(max_length=75, blank=True)), + ('address_1', models.CharField(max_length=255, blank=True)), + ('address_2', models.CharField(max_length=255, blank=True)), + ('city', models.CharField(max_length=255, blank=True)), + ('country', models.CharField(max_length=255, blank=True)), + ('post_code', models.CharField(max_length=10, blank=True)), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('feed_image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page', models.Model), + ), + migrations.CreateModel( + name='EventIndexPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventIndexPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('date_from', models.DateField(verbose_name=b'Start date')), + ('date_to', models.DateField(help_text=b'Not required if event is on a single day', null=True, verbose_name=b'End date', blank=True)), + ('time_from', models.TimeField(null=True, verbose_name=b'Start time', blank=True)), + ('time_to', models.TimeField(null=True, verbose_name=b'End time', blank=True)), + ('audience', models.CharField(max_length=255, choices=[(b'public', b'Public'), (b'private', b'Private')])), + ('location', models.CharField(max_length=255)), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('cost', models.CharField(max_length=255)), + ('signup_link', models.URLField(blank=True)), + ('feed_image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='EventPageCarouselItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), + ('caption', models.CharField(max_length=255, blank=True)), + ('image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='EventPageSpeaker', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('first_name', models.CharField(max_length=255, verbose_name=b'Name', blank=True)), + ('last_name', models.CharField(max_length=255, verbose_name=b'Surname', blank=True)), + ('image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormField', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('label', models.CharField(help_text='The label of the form field', max_length=255)), + ('field_type', models.CharField(max_length=16, choices=[(b'singleline', 'Single line text'), (b'multiline', 'Multi-line text'), (b'email', 'Email'), (b'number', 'Number'), (b'url', 'URL'), (b'checkbox', 'Checkbox'), (b'checkboxes', 'Checkboxes'), (b'dropdown', 'Drop down'), (b'radio', 'Radio buttons'), (b'date', 'Date'), (b'datetime', 'Date/time')])), + ('required', models.BooleanField(default=True)), + ('choices', models.CharField(help_text='Comma separated list of choices. Only applicable in checkboxes, radio and dropdown.', max_length=512, blank=True)), + ('default_value', models.CharField(help_text='Default value. Comma separated values supported for checkboxes.', max_length=255, blank=True)), + ('help_text', models.CharField(max_length=255, blank=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='FormPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('to_address', models.CharField(help_text='Optional - form submissions will be emailed to this address', max_length=255, blank=True)), + ('from_address', models.CharField(max_length=255, blank=True)), + ('subject', models.CharField(max_length=255, blank=True)), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('thank_you_text', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='HomePage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ], + options={ + 'verbose_name': 'Homepage', + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='HomePageCarouselItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), + ('caption', models.CharField(max_length=255, blank=True)), + ('image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='HomePageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='PersonPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('telephone', models.CharField(max_length=20, blank=True)), + ('email', models.EmailField(max_length=75, blank=True)), + ('address_1', models.CharField(max_length=255, blank=True)), + ('address_2', models.CharField(max_length=255, blank=True)), + ('city', models.CharField(max_length=255, blank=True)), + ('country', models.CharField(max_length=255, blank=True)), + ('post_code', models.CharField(max_length=10, blank=True)), + ('first_name', models.CharField(max_length=255)), + ('last_name', models.CharField(max_length=255)), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('biography', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('feed_image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page', models.Model), + ), + migrations.CreateModel( + name='PersonPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='StandardIndexPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('feed_image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardIndexPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='StandardPage', + fields=[ + ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), + ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), + ('feed_image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + migrations.CreateModel( + name='StandardPageCarouselItem', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('embed_url', models.URLField(verbose_name=b'Embed URL', blank=True)), + ('caption', models.CharField(max_length=255, blank=True)), + ('image', models.ForeignKey(related_name=b'+', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wagtailimages.Image', null=True)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(related_name=b'carousel_items', to='demo.StandardPage')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='StandardPageRelatedLink', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('sort_order', models.IntegerField(null=True, editable=False, blank=True)), + ('link_external', models.URLField(verbose_name=b'External link', blank=True)), + ('title', models.CharField(help_text=b'Link title', max_length=255)), + ('link_document', models.ForeignKey(related_name=b'+', blank=True, to='wagtaildocs.Document', null=True)), + ('link_page', models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True)), + ('page', modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.StandardPage')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='standardindexpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='standardindexpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.StandardIndexPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='personpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='personpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.PersonPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='homepagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='homepagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.HomePage'), + preserve_default=True, + ), + migrations.AddField( + model_name='homepagecarouselitem', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='homepagecarouselitem', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'carousel_items', to='demo.HomePage'), + preserve_default=True, + ), + migrations.AddField( + model_name='formfield', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'form_fields', to='demo.FormPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagespeaker', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagespeaker', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'speakers', to='demo.EventPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.EventPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagecarouselitem', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventpagecarouselitem', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'carousel_items', to='demo.EventPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='eventindexpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='eventindexpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.EventIndexPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='blogpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='blogpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.BlogPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='blogpagecarouselitem', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='blogpagecarouselitem', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'carousel_items', to='demo.BlogPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='blogpage', + name='tags', + field=modelcluster.tags.ClusterTaggableManager(to='taggit.Tag', through='demo.BlogPageTag', blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags'), + preserve_default=True, + ), + migrations.AddField( + model_name='blogindexpagerelatedlink', + name='link_page', + field=models.ForeignKey(related_name=b'+', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + migrations.AddField( + model_name='blogindexpagerelatedlink', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'related_links', to='demo.BlogIndexPage'), + preserve_default=True, + ), + migrations.AddField( + model_name='advertplacement', + name='page', + field=modelcluster.fields.ParentalKey(related_name=b'advert_placements', to='wagtailcore.Page'), + preserve_default=True, + ), + migrations.AddField( + model_name='advert', + name='page', + field=models.ForeignKey(related_name=b'adverts', blank=True, to='wagtailcore.Page', null=True), + preserve_default=True, + ), + ] diff --git a/examples/wagtaildemo/demo/migrations/0002_auto_20150917_1037.py b/examples/wagtaildemo/demo/migrations/0002_auto_20150917_1037.py new file mode 100644 index 00000000..8a2bc7ed --- /dev/null +++ b/examples/wagtaildemo/demo/migrations/0002_auto_20150917_1037.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import demo.models +import wagtail.wagtaildocs.blocks +import wagtail.wagtailimages.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtailcore.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='homepage', + name='body', + field=wagtail.wagtailcore.fields.StreamField([(b'h2', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', icon=b'title')), (b'h3', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', icon=b'title')), (b'h4', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', icon=b'title')), (b'intro', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'pilcrow')), (b'paragraph', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'pilcrow')), (b'aligned_image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'caption', wagtail.wagtailcore.blocks.RichTextBlock()), (b'alignment', demo.models.ImageFormatChoiceBlock())], icon=b'image', label=b'Aligned image')), (b'pullquote', wagtail.wagtailcore.blocks.StructBlock([(b'quote', wagtail.wagtailcore.blocks.TextBlock(b'quote title')), (b'attribution', wagtail.wagtailcore.blocks.CharBlock())])), (b'aligned_html', wagtail.wagtailcore.blocks.StructBlock([(b'html', wagtail.wagtailcore.blocks.RawHTMLBlock()), (b'alignment', demo.models.HTMLAlignmentChoiceBlock())], label=b'Raw HTML', icon=b'code')), (b'document', wagtail.wagtaildocs.blocks.DocumentChooserBlock(icon=b'doc-full-inverse'))]), + ) + ] diff --git a/examples/wagtaildemo/demo/migrations/0002_auto__add_field_standardpage_postcode.py b/examples/wagtaildemo/demo/migrations/0002_auto__add_field_standardpage_postcode.py deleted file mode 100644 index 12f44764..00000000 --- a/examples/wagtaildemo/demo/migrations/0002_auto__add_field_standardpage_postcode.py +++ /dev/null @@ -1,341 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'StandardPage.postcode' - db.add_column(u'demo_standardpage', 'postcode', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'StandardPage.postcode' - db.delete_column(u'demo_standardpage', 'postcode') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'demo.advert': { - 'Meta': {'object_name': 'Advert'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adverts'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'demo.advertplacement': { - 'Meta': {'object_name': 'AdvertPlacement'}, - 'advert': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': u"orm['demo.Advert']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'advert_placements'", 'to': u"orm['wagtailcore.Page']"}) - }, - u'demo.blogindexpage': { - 'Meta': {'object_name': 'BlogIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpage': { - 'Meta': {'object_name': 'BlogPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.blogpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpagetag': { - 'Meta': {'object_name': 'BlogPageTag'}, - 'content_object': ('modelcluster.fields.ParentalKey', [], {'related_name': "'tagged_items'", 'to': u"orm['demo.BlogPage']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'demo_blogpagetag_items'", 'to': u"orm['taggit.Tag']"}) - }, - u'demo.contactpage': { - 'Meta': {'object_name': 'ContactPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.eventindexpage': { - 'Meta': {'object_name': 'EventIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.eventindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpage': { - 'Meta': {'object_name': 'EventPage', '_ormbases': [u'wagtailcore.Page']}, - 'audience': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'cost': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'date_from': ('django.db.models.fields.DateField', [], {}), - 'date_to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'signup_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'time_from': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}), - 'time_to': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpagespeaker': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageSpeaker'}, - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'speakers'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepage': { - 'Meta': {'object_name': 'HomePage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.homepagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.personpage': { - 'Meta': {'object_name': 'PersonPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'biography': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.personpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'PersonPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.PersonPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardindexpage': { - 'Meta': {'object_name': 'StandardIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardpage': { - 'Meta': {'object_name': 'StandardPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'postcode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}) - }, - u'demo.standardpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.standardpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'taggit.tag': { - 'Meta': {'object_name': 'Tag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) - }, - u'wagtailcore.page': { - 'Meta': {'object_name': 'Page'}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pages'", 'to': u"orm['contenttypes.ContentType']"}), - 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'has_unpublished_changes': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'live': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_pages'", 'null': 'True', 'to': u"orm['auth.User']"}), - 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'search_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'seo_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'show_in_menus': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}) - }, - u'wagtaildocs.document': { - 'Meta': {'object_name': 'Document'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) - }, - u'wagtailimages.image': { - 'Meta': {'object_name': 'Image'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'height': ('django.db.models.fields.IntegerField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'width': ('django.db.models.fields.IntegerField', [], {}) - } - } - - complete_apps = ['demo'] \ No newline at end of file diff --git a/examples/wagtaildemo/demo/migrations/0003_auto_20150917_1200.py b/examples/wagtaildemo/demo/migrations/0003_auto_20150917_1200.py new file mode 100644 index 00000000..e501662a --- /dev/null +++ b/examples/wagtaildemo/demo/migrations/0003_auto_20150917_1200.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import demo.models +import wagtail.wagtaildocs.blocks +import wagtail.wagtailimages.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtailcore.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0002_auto_20150917_1037'), + ] + + operations = [ + migrations.AlterField( + model_name='blogpage', + name='body', + field=wagtail.wagtailcore.fields.StreamField([(b'h2', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', icon=b'title')), (b'h3', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', icon=b'title')), (b'h4', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', icon=b'title')), (b'intro', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'pilcrow')), (b'paragraph', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'pilcrow')), (b'aligned_image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'caption', wagtail.wagtailcore.blocks.RichTextBlock()), (b'alignment', demo.models.ImageFormatChoiceBlock())], icon=b'image', label=b'Aligned image')), (b'pullquote', wagtail.wagtailcore.blocks.StructBlock([(b'quote', wagtail.wagtailcore.blocks.TextBlock(b'quote title')), (b'attribution', wagtail.wagtailcore.blocks.CharBlock())])), (b'aligned_html', wagtail.wagtailcore.blocks.StructBlock([(b'html', wagtail.wagtailcore.blocks.RawHTMLBlock()), (b'alignment', demo.models.HTMLAlignmentChoiceBlock())], label=b'Raw HTML', icon=b'code')), (b'document', wagtail.wagtaildocs.blocks.DocumentChooserBlock(icon=b'doc-full-inverse'))]), + ) + ] diff --git a/examples/wagtaildemo/demo/migrations/0003_auto__del_field_standardpage_postcode.py b/examples/wagtaildemo/demo/migrations/0003_auto__del_field_standardpage_postcode.py deleted file mode 100644 index 47b6d133..00000000 --- a/examples/wagtaildemo/demo/migrations/0003_auto__del_field_standardpage_postcode.py +++ /dev/null @@ -1,340 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'StandardPage.postcode' - db.delete_column(u'demo_standardpage', 'postcode') - - - def backwards(self, orm): - # Adding field 'StandardPage.postcode' - db.add_column(u'demo_standardpage', 'postcode', - self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), - keep_default=False) - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'demo.advert': { - 'Meta': {'object_name': 'Advert'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adverts'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'demo.advertplacement': { - 'Meta': {'object_name': 'AdvertPlacement'}, - 'advert': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': u"orm['demo.Advert']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'advert_placements'", 'to': u"orm['wagtailcore.Page']"}) - }, - u'demo.blogindexpage': { - 'Meta': {'object_name': 'BlogIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpage': { - 'Meta': {'object_name': 'BlogPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.blogpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpagetag': { - 'Meta': {'object_name': 'BlogPageTag'}, - 'content_object': ('modelcluster.fields.ParentalKey', [], {'related_name': "'tagged_items'", 'to': u"orm['demo.BlogPage']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'demo_blogpagetag_items'", 'to': u"orm['taggit.Tag']"}) - }, - u'demo.contactpage': { - 'Meta': {'object_name': 'ContactPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.eventindexpage': { - 'Meta': {'object_name': 'EventIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.eventindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpage': { - 'Meta': {'object_name': 'EventPage', '_ormbases': [u'wagtailcore.Page']}, - 'audience': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'cost': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'date_from': ('django.db.models.fields.DateField', [], {}), - 'date_to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'signup_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'time_from': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}), - 'time_to': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpagespeaker': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageSpeaker'}, - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'speakers'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepage': { - 'Meta': {'object_name': 'HomePage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.homepagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.personpage': { - 'Meta': {'object_name': 'PersonPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'biography': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.personpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'PersonPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.PersonPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardindexpage': { - 'Meta': {'object_name': 'StandardIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardpage': { - 'Meta': {'object_name': 'StandardPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.standardpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'taggit.tag': { - 'Meta': {'object_name': 'Tag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) - }, - u'wagtailcore.page': { - 'Meta': {'object_name': 'Page'}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pages'", 'to': u"orm['contenttypes.ContentType']"}), - 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'has_unpublished_changes': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'live': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_pages'", 'null': 'True', 'to': u"orm['auth.User']"}), - 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'search_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'seo_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'show_in_menus': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}) - }, - u'wagtaildocs.document': { - 'Meta': {'object_name': 'Document'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) - }, - u'wagtailimages.image': { - 'Meta': {'object_name': 'Image'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'height': ('django.db.models.fields.IntegerField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'width': ('django.db.models.fields.IntegerField', [], {}) - } - } - - complete_apps = ['demo'] \ No newline at end of file diff --git a/examples/wagtaildemo/demo/migrations/0004_auto_20151019_1351.py b/examples/wagtaildemo/demo/migrations/0004_auto_20151019_1351.py new file mode 100644 index 00000000..ab5a987a --- /dev/null +++ b/examples/wagtaildemo/demo/migrations/0004_auto_20151019_1351.py @@ -0,0 +1,249 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import wagtail.wagtailimages.blocks +import wagtail.wagtailcore.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtaildocs.blocks +import demo.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0003_auto_20150917_1200'), + ] + + operations = [ + migrations.AlterField( + model_name='blogindexpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='blogindexpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='blogpage', + name='body', + field=wagtail.wagtailcore.fields.StreamField((('h2', wagtail.wagtailcore.blocks.CharBlock(icon='title', classname='title')), ('h3', wagtail.wagtailcore.blocks.CharBlock(icon='title', classname='title')), ('h4', wagtail.wagtailcore.blocks.CharBlock(icon='title', classname='title')), ('intro', wagtail.wagtailcore.blocks.RichTextBlock(icon='pilcrow')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock(icon='pilcrow')), ('aligned_image', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.RichTextBlock()), ('alignment', demo.models.ImageFormatChoiceBlock())), label='Aligned image', icon='image')), ('pullquote', wagtail.wagtailcore.blocks.StructBlock((('quote', wagtail.wagtailcore.blocks.TextBlock('quote title')), ('attribution', wagtail.wagtailcore.blocks.CharBlock())))), ('aligned_html', wagtail.wagtailcore.blocks.StructBlock((('html', wagtail.wagtailcore.blocks.RawHTMLBlock()), ('alignment', demo.models.HTMLAlignmentChoiceBlock())), label='Raw HTML', icon='code')), ('document', wagtail.wagtaildocs.blocks.DocumentChooserBlock(icon='doc-full-inverse')))), + ), + migrations.AlterField( + model_name='blogpage', + name='date', + field=models.DateField(verbose_name='Post date'), + ), + migrations.AlterField( + model_name='blogpagecarouselitem', + name='embed_url', + field=models.URLField(verbose_name='Embed URL', blank=True), + ), + migrations.AlterField( + model_name='blogpagecarouselitem', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='blogpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='blogpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='contactpage', + name='email', + field=models.EmailField(max_length=254, blank=True), + ), + migrations.AlterField( + model_name='eventindexpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='eventindexpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='eventpage', + name='audience', + field=models.CharField(max_length=255, choices=[('public', 'Public'), ('private', 'Private')]), + ), + migrations.AlterField( + model_name='eventpage', + name='date_from', + field=models.DateField(verbose_name='Start date'), + ), + migrations.AlterField( + model_name='eventpage', + name='date_to', + field=models.DateField(help_text='Not required if event is on a single day', verbose_name='End date', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpage', + name='time_from', + field=models.TimeField(verbose_name='Start time', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpage', + name='time_to', + field=models.TimeField(verbose_name='End time', null=True, blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='embed_url', + field=models.URLField(verbose_name='Embed URL', blank=True), + ), + migrations.AlterField( + model_name='eventpagecarouselitem', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='eventpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='first_name', + field=models.CharField(max_length=255, verbose_name='Name', blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='last_name', + field=models.CharField(max_length=255, verbose_name='Surname', blank=True), + ), + migrations.AlterField( + model_name='eventpagespeaker', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='formfield', + name='choices', + field=models.CharField(max_length=512, help_text='Comma separated list of choices. Only applicable in checkboxes, radio and dropdown.', verbose_name='Choices', blank=True), + ), + migrations.AlterField( + model_name='formfield', + name='default_value', + field=models.CharField(max_length=255, help_text='Default value. Comma separated values supported for checkboxes.', verbose_name='Default value', blank=True), + ), + migrations.AlterField( + model_name='formfield', + name='field_type', + field=models.CharField(max_length=16, choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], verbose_name='Field type'), + ), + migrations.AlterField( + model_name='formfield', + name='help_text', + field=models.CharField(max_length=255, verbose_name='Help text', blank=True), + ), + migrations.AlterField( + model_name='formfield', + name='label', + field=models.CharField(max_length=255, help_text='The label of the form field', verbose_name='Label'), + ), + migrations.AlterField( + model_name='formfield', + name='required', + field=models.BooleanField(verbose_name='Required', default=True), + ), + migrations.AlterField( + model_name='formpage', + name='from_address', + field=models.CharField(max_length=255, verbose_name='From address', blank=True), + ), + migrations.AlterField( + model_name='formpage', + name='subject', + field=models.CharField(max_length=255, verbose_name='Subject', blank=True), + ), + migrations.AlterField( + model_name='formpage', + name='to_address', + field=models.CharField(max_length=255, help_text='Optional - form submissions will be emailed to this address', verbose_name='To address', blank=True), + ), + migrations.AlterField( + model_name='homepage', + name='body', + field=wagtail.wagtailcore.fields.StreamField((('h2', wagtail.wagtailcore.blocks.CharBlock(icon='title', classname='title')), ('h3', wagtail.wagtailcore.blocks.CharBlock(icon='title', classname='title')), ('h4', wagtail.wagtailcore.blocks.CharBlock(icon='title', classname='title')), ('intro', wagtail.wagtailcore.blocks.RichTextBlock(icon='pilcrow')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock(icon='pilcrow')), ('aligned_image', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.RichTextBlock()), ('alignment', demo.models.ImageFormatChoiceBlock())), label='Aligned image', icon='image')), ('pullquote', wagtail.wagtailcore.blocks.StructBlock((('quote', wagtail.wagtailcore.blocks.TextBlock('quote title')), ('attribution', wagtail.wagtailcore.blocks.CharBlock())))), ('aligned_html', wagtail.wagtailcore.blocks.StructBlock((('html', wagtail.wagtailcore.blocks.RawHTMLBlock()), ('alignment', demo.models.HTMLAlignmentChoiceBlock())), label='Raw HTML', icon='code')), ('document', wagtail.wagtaildocs.blocks.DocumentChooserBlock(icon='doc-full-inverse')))), + ), + migrations.AlterField( + model_name='homepagecarouselitem', + name='embed_url', + field=models.URLField(verbose_name='Embed URL', blank=True), + ), + migrations.AlterField( + model_name='homepagecarouselitem', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='homepagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='homepagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='personpage', + name='email', + field=models.EmailField(max_length=254, blank=True), + ), + migrations.AlterField( + model_name='personpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='personpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='standardindexpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='standardindexpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + migrations.AlterField( + model_name='standardpagecarouselitem', + name='embed_url', + field=models.URLField(verbose_name='Embed URL', blank=True), + ), + migrations.AlterField( + model_name='standardpagecarouselitem', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='standardpagerelatedlink', + name='link_external', + field=models.URLField(verbose_name='External link', blank=True), + ), + migrations.AlterField( + model_name='standardpagerelatedlink', + name='title', + field=models.CharField(max_length=255, help_text='Link title'), + ), + ] diff --git a/examples/wagtaildemo/demo/migrations/0004_create_form_page.py b/examples/wagtaildemo/demo/migrations/0004_create_form_page.py deleted file mode 100644 index fa9b43c6..00000000 --- a/examples/wagtaildemo/demo/migrations/0004_create_form_page.py +++ /dev/null @@ -1,384 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'FormField' - db.create_table(u'demo_formfield', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sort_order', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('label', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('field_type', self.gf('django.db.models.fields.CharField')(max_length=16)), - ('required', self.gf('django.db.models.fields.BooleanField')(default=True)), - ('choices', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)), - ('default_value', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('help_text', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('page', self.gf('modelcluster.fields.ParentalKey')(related_name='form_fields', to=orm['demo.FormPage'])), - )) - db.send_create_signal(u'demo', ['FormField']) - - # Adding model 'FormPage' - db.create_table(u'demo_formpage', ( - (u'page_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['wagtailcore.Page'], unique=True, primary_key=True)), - ('to_address', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('from_address', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('subject', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('intro', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - ('thank_you_text', self.gf('wagtail.wagtailcore.fields.RichTextField')(blank=True)), - )) - db.send_create_signal(u'demo', ['FormPage']) - - - def backwards(self, orm): - # Deleting model 'FormField' - db.delete_table(u'demo_formfield') - - # Deleting model 'FormPage' - db.delete_table(u'demo_formpage') - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - u'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - u'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - u'demo.advert': { - 'Meta': {'object_name': 'Advert'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adverts'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'text': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) - }, - u'demo.advertplacement': { - 'Meta': {'object_name': 'AdvertPlacement'}, - 'advert': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': u"orm['demo.Advert']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'advert_placements'", 'to': u"orm['wagtailcore.Page']"}) - }, - u'demo.blogindexpage': { - 'Meta': {'object_name': 'BlogIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpage': { - 'Meta': {'object_name': 'BlogPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {}), - 'date': ('django.db.models.fields.DateField', [], {}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.blogpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.blogpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'BlogPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.BlogPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.blogpagetag': { - 'Meta': {'object_name': 'BlogPageTag'}, - 'content_object': ('modelcluster.fields.ParentalKey', [], {'related_name': "'tagged_items'", 'to': u"orm['demo.BlogPage']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'demo_blogpagetag_items'", 'to': u"orm['taggit.Tag']"}) - }, - u'demo.contactpage': { - 'Meta': {'object_name': 'ContactPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.eventindexpage': { - 'Meta': {'object_name': 'EventIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.eventindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpage': { - 'Meta': {'object_name': 'EventPage', '_ormbases': [u'wagtailcore.Page']}, - 'audience': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'cost': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'date_from': ('django.db.models.fields.DateField', [], {}), - 'date_to': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'location': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'signup_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'time_from': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}), - 'time_to': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.eventpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.eventpagespeaker': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'EventPageSpeaker'}, - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'speakers'", 'to': u"orm['demo.EventPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.formfield': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'FormField'}, - 'choices': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), - 'default_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'field_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), - 'help_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'form_fields'", 'to': u"orm['demo.FormPage']"}), - 'required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.formpage': { - 'Meta': {'object_name': 'FormPage'}, - 'from_address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'thank_you_text': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'to_address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}) - }, - u'demo.homepage': { - 'Meta': {'object_name': 'HomePage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.homepagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.homepagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'HomePageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.HomePage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.personpage': { - 'Meta': {'object_name': 'PersonPage', '_ormbases': [u'wagtailcore.Page']}, - 'address_1': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'address_2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'biography': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}), - 'post_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}), - 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}) - }, - u'demo.personpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'PersonPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.PersonPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardindexpage': { - 'Meta': {'object_name': 'StandardIndexPage', '_ormbases': [u'wagtailcore.Page']}, - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardindexpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardIndexPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardIndexPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'demo.standardpage': { - 'Meta': {'object_name': 'StandardPage', '_ormbases': [u'wagtailcore.Page']}, - 'body': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - 'feed_image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'intro': ('wagtail.wagtailcore.fields.RichTextField', [], {'blank': 'True'}), - u'page_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['wagtailcore.Page']", 'unique': 'True', 'primary_key': 'True'}) - }, - u'demo.standardpagecarouselitem': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageCarouselItem'}, - 'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'embed_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'image': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': u"orm['wagtailimages.Image']"}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'carousel_items'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) - }, - u'demo.standardpagerelatedlink': { - 'Meta': {'ordering': "['sort_order']", 'object_name': 'StandardPageRelatedLink'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link_document': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtaildocs.Document']"}), - 'link_external': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'link_page': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['wagtailcore.Page']"}), - 'page': ('modelcluster.fields.ParentalKey', [], {'related_name': "'related_links'", 'to': u"orm['demo.StandardPage']"}), - 'sort_order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'taggit.tag': { - 'Meta': {'object_name': 'Tag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) - }, - u'wagtailcore.page': { - 'Meta': {'object_name': 'Page'}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pages'", 'to': u"orm['contenttypes.ContentType']"}), - 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'has_unpublished_changes': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'live': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), - 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_pages'", 'null': 'True', 'to': u"orm['auth.User']"}), - 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), - 'search_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'seo_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'show_in_menus': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'url_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}) - }, - u'wagtaildocs.document': { - 'Meta': {'object_name': 'Document'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) - }, - u'wagtailimages.image': { - 'Meta': {'object_name': 'Image'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'height': ('django.db.models.fields.IntegerField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'uploaded_by_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'width': ('django.db.models.fields.IntegerField', [], {}) - } - } - - complete_apps = ['demo'] \ No newline at end of file diff --git a/examples/wagtaildemo/demo/migrations/0005_auto_20160531_1736.py b/examples/wagtaildemo/demo/migrations/0005_auto_20160531_1736.py new file mode 100644 index 00000000..29062c9d --- /dev/null +++ b/examples/wagtaildemo/demo/migrations/0005_auto_20160531_1736.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0004_auto_20151019_1351'), + ] + + operations = [ + migrations.AlterField( + model_name='formfield', + name='choices', + field=models.CharField(blank=True, max_length=512, verbose_name='choices', help_text='Comma separated list of choices. Only applicable in checkboxes, radio and dropdown.'), + ), + migrations.AlterField( + model_name='formfield', + name='default_value', + field=models.CharField(blank=True, max_length=255, verbose_name='default value', help_text='Default value. Comma separated values supported for checkboxes.'), + ), + migrations.AlterField( + model_name='formfield', + name='field_type', + field=models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16, verbose_name='field type'), + ), + migrations.AlterField( + model_name='formfield', + name='help_text', + field=models.CharField(blank=True, max_length=255, verbose_name='help text'), + ), + migrations.AlterField( + model_name='formfield', + name='label', + field=models.CharField(help_text='The label of the form field', max_length=255, verbose_name='label'), + ), + migrations.AlterField( + model_name='formfield', + name='required', + field=models.BooleanField(verbose_name='required', default=True), + ), + migrations.AlterField( + model_name='formpage', + name='from_address', + field=models.CharField(blank=True, max_length=255, verbose_name='from address'), + ), + migrations.AlterField( + model_name='formpage', + name='subject', + field=models.CharField(blank=True, max_length=255, verbose_name='subject'), + ), + migrations.AlterField( + model_name='formpage', + name='to_address', + field=models.CharField(blank=True, max_length=255, verbose_name='to address', help_text='Optional - form submissions will be emailed to this address'), + ), + ] diff --git a/examples/wagtaildemo/demo/migrations/0006_auto_20160902_1204.py b/examples/wagtaildemo/demo/migrations/0006_auto_20160902_1204.py new file mode 100644 index 00000000..88273fb6 --- /dev/null +++ b/examples/wagtaildemo/demo/migrations/0006_auto_20160902_1204.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.1 on 2016-09-02 11:04 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('demo', '0005_auto_20160531_1736'), + ] + + operations = [ + migrations.AlterField( + model_name='formfield', + name='choices', + field=models.TextField(blank=True, help_text='Comma separated list of choices. Only applicable in checkboxes, radio and dropdown.', verbose_name='choices'), + ), + migrations.AlterField( + model_name='formpage', + name='to_address', + field=models.CharField(blank=True, help_text='Optional - form submissions will be emailed to these addresses. Separate multiple addresses by comma.', max_length=255, verbose_name='to address'), + ), + ] diff --git a/examples/wagtaildemo/demo/models.py b/examples/wagtaildemo/demo/models.py index 0610cb44..cd965258 100644 --- a/examples/wagtaildemo/demo/models.py +++ b/examples/wagtaildemo/demo/models.py @@ -2,26 +2,27 @@ from datetime import date from django.db import models from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger -from django.core.management import call_command -from django.dispatch import receiver -from django.shortcuts import render from django.http import HttpResponse +from django.utils.encoding import python_2_unicode_compatible +from django import forms from wagtail.wagtailcore.models import Page, Orderable -from wagtail.wagtailcore.fields import RichTextField -from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, \ - InlinePanel, PageChooserPanel +from wagtail.wagtailcore.fields import RichTextField, StreamField +from wagtail.wagtailadmin.edit_handlers import FieldPanel, FieldRowPanel, MultiFieldPanel, \ + InlinePanel, PageChooserPanel, StreamFieldPanel from wagtail.wagtailimages.edit_handlers import ImageChooserPanel -from wagtail.wagtailimages.models import Image from wagtail.wagtaildocs.edit_handlers import DocumentChooserPanel from wagtail.wagtailsnippets.models import register_snippet from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField from wagtail.wagtailsearch import index +from wagtail.wagtailcore.blocks import TextBlock, StructBlock, StreamBlock, FieldBlock, CharBlock, RichTextBlock, RawHTMLBlock +from wagtail.wagtailimages.blocks import ImageChooserBlock +from wagtail.wagtaildocs.blocks import DocumentChooserBlock + from modelcluster.fields import ParentalKey from modelcluster.tags import ClusterTaggableManager -from taggit.models import Tag, TaggedItemBase -from south.signals import post_migrate +from taggit.models import TaggedItemBase from demo.utils import export_event @@ -31,6 +32,54 @@ EVENT_AUDIENCE_CHOICES = ( ('private', "Private"), ) +# Global Streamfield definition + + +class PullQuoteBlock(StructBlock): + quote = TextBlock("quote title") + attribution = CharBlock() + + class Meta: + icon = "openquote" + + +class ImageFormatChoiceBlock(FieldBlock): + field = forms.ChoiceField(choices=( + ('left', 'Wrap left'), ('right', 'Wrap right'), ('mid', 'Mid width'), ('full', 'Full width'), + )) + + +class HTMLAlignmentChoiceBlock(FieldBlock): + field = forms.ChoiceField(choices=( + ('normal', 'Normal'), ('full', 'Full width'), + )) + + +class ImageBlock(StructBlock): + image = ImageChooserBlock() + caption = RichTextBlock() + alignment = ImageFormatChoiceBlock() + + +class AlignedHTMLBlock(StructBlock): + html = RawHTMLBlock() + alignment = HTMLAlignmentChoiceBlock() + + class Meta: + icon = "code" + + +class DemoStreamBlock(StreamBlock): + h2 = CharBlock(icon="title", classname="title") + h3 = CharBlock(icon="title", classname="title") + h4 = CharBlock(icon="title", classname="title") + intro = RichTextBlock(icon="pilcrow") + paragraph = RichTextBlock(icon="pilcrow") + aligned_image = ImageBlock(label="Aligned image", icon="image") + pullquote = PullQuoteBlock() + aligned_html = AlignedHTMLBlock(icon="code", label='Raw HTML') + document = DocumentChooserBlock(icon="doc-full-inverse") + # A couple of abstract classes that contain commonly used fields @@ -64,6 +113,8 @@ class LinkFields(models.Model): DocumentChooserPanel('link_document'), ] + api_fields = ['link_external', 'link_page', 'link_document'] + class Meta: abstract = True @@ -87,6 +138,8 @@ class ContactFields(models.Model): FieldPanel('post_code'), ] + api_fields = ['telephone', 'email', 'address_1', 'address_2', 'city', 'country', 'post_code'] + class Meta: abstract = True @@ -111,6 +164,8 @@ class CarouselItem(LinkFields): MultiFieldPanel(LinkFields.panels, "Link"), ] + api_fields = ['image', 'embed_url', 'caption'] + LinkFields.api_fields + class Meta: abstract = True @@ -125,6 +180,8 @@ class RelatedLink(LinkFields): MultiFieldPanel(LinkFields.panels, "Link"), ] + api_fields = ['title'] + LinkFields.api_fields + class Meta: abstract = True @@ -135,7 +192,10 @@ class AdvertPlacement(models.Model): page = ParentalKey('wagtailcore.Page', related_name='advert_placements') advert = models.ForeignKey('demo.Advert', related_name='+') + api_fields = ['advert'] + +@python_2_unicode_compatible class Advert(models.Model): page = models.ForeignKey( 'wagtailcore.Page', @@ -152,7 +212,9 @@ class Advert(models.Model): FieldPanel('text'), ] - def __unicode__(self): + api_fields = ['page', 'url', 'text'] + + def __str__(self): return self.text register_snippet(Advert) @@ -169,25 +231,24 @@ class HomePageRelatedLink(Orderable, RelatedLink): class HomePage(Page): - body = RichTextField(blank=True) - - search_fields = Page.search_fields + ( + body = StreamField(DemoStreamBlock()) + search_fields = Page.search_fields + [ index.SearchField('body'), - ) + ] + + api_fields = ['body', 'carousel_items', 'related_links'] class Meta: verbose_name = "Homepage" HomePage.content_panels = [ FieldPanel('title', classname="full title"), - FieldPanel('body', classname="full"), - InlinePanel(HomePage, 'carousel_items', label="Carousel items"), - InlinePanel(HomePage, 'related_links', label="Related links"), + StreamFieldPanel('body'), + InlinePanel('carousel_items', label="Carousel items"), + InlinePanel('related_links', label="Related links"), ] -HomePage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), -] +HomePage.promote_panels = Page.promote_panels # Standard index page @@ -206,18 +267,19 @@ class StandardIndexPage(Page): related_name='+' ) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('intro'), - ) + ] + + api_fields = ['intro', 'feed_image'] StandardIndexPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('intro', classname="full"), - InlinePanel(StandardIndexPage, 'related_links', label="Related links"), + InlinePanel('related_links', label="Related links"), ] -StandardIndexPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), +StandardIndexPage.promote_panels = Page.promote_panels + [ ImageChooserPanel('feed_image'), ] @@ -243,21 +305,22 @@ class StandardPage(Page): related_name='+' ) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('intro'), index.SearchField('body'), - ) + ] + + api_fields = ['intro', 'body', 'feed_image', 'carousel_items', 'related_links'] StandardPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('intro', classname="full"), - InlinePanel(StandardPage, 'carousel_items', label="Carousel items"), + InlinePanel('carousel_items', label="Carousel items"), FieldPanel('body', classname="full"), - InlinePanel(StandardPage, 'related_links', label="Related links"), + InlinePanel('related_links', label="Related links"), ] -StandardPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), +StandardPage.promote_panels = Page.promote_panels + [ ImageChooserPanel('feed_image'), ] @@ -271,9 +334,11 @@ class BlogIndexPageRelatedLink(Orderable, RelatedLink): class BlogIndexPage(Page): intro = RichTextField(blank=True) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('intro'), - ) + ] + + api_fields = ['intro', 'related_links'] @property def blogs(self): @@ -312,12 +377,10 @@ class BlogIndexPage(Page): BlogIndexPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('intro', classname="full"), - InlinePanel(BlogIndexPage, 'related_links', label="Related links"), + InlinePanel('related_links', label="Related links"), ] -BlogIndexPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), -] +BlogIndexPage.promote_panels = Page.promote_panels # Blog page @@ -335,7 +398,7 @@ class BlogPageTag(TaggedItemBase): class BlogPage(Page): - body = RichTextField() + body = StreamField(DemoStreamBlock()) tags = ClusterTaggableManager(through=BlogPageTag, blank=True) date = models.DateField("Post date") feed_image = models.ForeignKey( @@ -346,9 +409,11 @@ class BlogPage(Page): related_name='+' ) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('body'), - ) + ] + + api_fields = ['body', 'tags', 'date', 'feed_image', 'carousel_items', 'related_links'] @property def blog_index(self): @@ -358,13 +423,12 @@ class BlogPage(Page): BlogPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('date'), - FieldPanel('body', classname="full"), - InlinePanel(BlogPage, 'carousel_items', label="Carousel items"), - InlinePanel(BlogPage, 'related_links', label="Related links"), + StreamFieldPanel('body'), + InlinePanel('carousel_items', label="Carousel items"), + InlinePanel('related_links', label="Related links"), ] -BlogPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), +BlogPage.promote_panels = Page.promote_panels + [ ImageChooserPanel('feed_image'), FieldPanel('tags'), ] @@ -396,12 +460,14 @@ class PersonPage(Page, ContactFields): related_name='+' ) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('first_name'), index.SearchField('last_name'), index.SearchField('intro'), index.SearchField('biography'), - ) + ] + + api_fields = ['first_name', 'last_name', 'intro', 'biography', 'image', 'feed_image'] + ContactFields.api_fields + ['related_links'] PersonPage.content_panels = [ FieldPanel('title', classname="full title"), @@ -411,11 +477,10 @@ PersonPage.content_panels = [ FieldPanel('biography', classname="full"), ImageChooserPanel('image'), MultiFieldPanel(ContactFields.panels, "Contact"), - InlinePanel(PersonPage, 'related_links', label="Related links"), + InlinePanel('related_links', label="Related links"), ] -PersonPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), +PersonPage.promote_panels = Page.promote_panels + [ ImageChooserPanel('feed_image'), ] @@ -432,9 +497,11 @@ class ContactPage(Page, ContactFields): related_name='+' ) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('body'), - ) + ] + + api_fields = ['body', 'feed_image'] + ContactFields.api_fields ContactPage.content_panels = [ FieldPanel('title', classname="full title"), @@ -442,8 +509,7 @@ ContactPage.content_panels = [ MultiFieldPanel(ContactFields.panels, "Contact"), ] -ContactPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), +ContactPage.promote_panels = Page.promote_panels + [ ImageChooserPanel('feed_image'), ] @@ -457,9 +523,11 @@ class EventIndexPageRelatedLink(Orderable, RelatedLink): class EventIndexPage(Page): intro = RichTextField(blank=True) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('intro'), - ) + ] + + api_fields = ['intro', 'related_links'] @property def events(self): @@ -478,12 +546,10 @@ class EventIndexPage(Page): EventIndexPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('intro', classname="full"), - InlinePanel(EventIndexPage, 'related_links', label="Related links"), + InlinePanel('related_links', label="Related links"), ] -EventIndexPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), -] +EventIndexPage.promote_panels = Page.promote_panels # Event page @@ -519,6 +585,8 @@ class EventPageSpeaker(Orderable, LinkFields): MultiFieldPanel(LinkFields.panels, "Link"), ] + api_fields = ['first_name', 'last_name', 'image'] + class EventPage(Page): date_from = models.DateField("Start date") @@ -543,11 +611,13 @@ class EventPage(Page): related_name='+' ) - search_fields = Page.search_fields + ( + search_fields = Page.search_fields + [ index.SearchField('get_audience_display'), index.SearchField('location'), index.SearchField('body'), - ) + ] + + api_fields = ['date_from', 'date_to', 'time_from', 'time_to', 'audience', 'location', 'body', 'cost', 'signup_link', 'feed_image', 'speakers', 'carousel_items', 'related_links'] @property def event_index(self): @@ -582,14 +652,13 @@ EventPage.content_panels = [ FieldPanel('audience'), FieldPanel('cost'), FieldPanel('signup_link'), - InlinePanel(EventPage, 'carousel_items', label="Carousel items"), + InlinePanel('carousel_items', label="Carousel items"), FieldPanel('body', classname="full"), - InlinePanel(EventPage, 'speakers', label="Speakers"), - InlinePanel(EventPage, 'related_links', label="Related links"), + InlinePanel('speakers', label="Speakers"), + InlinePanel('related_links', label="Related links"), ] -EventPage.promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), +EventPage.promote_panels = Page.promote_panels + [ ImageChooserPanel('feed_image'), ] @@ -597,6 +666,7 @@ EventPage.promote_panels = [ class FormField(AbstractFormField): page = ParentalKey('FormPage', related_name='form_fields') + class FormPage(AbstractEmailForm): intro = RichTextField(blank=True) thank_you_text = RichTextField(blank=True) @@ -604,48 +674,13 @@ class FormPage(AbstractEmailForm): FormPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('intro', classname="full"), - InlinePanel(FormPage, 'form_fields', label="Form fields"), + 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") + FieldRowPanel([ + FieldPanel('from_address', classname="col6"), + FieldPanel('to_address', classname="col6"), + ]), + FieldPanel('subject'), + ], "Email"), ] - - -# Signal handler to load demo data from fixtures after migrations have completed -@receiver(post_migrate) -def import_demo_data(sender, **kwargs): - # post_migrate will be fired after every app is migrated; we only want to do the import - # after demo has been migrated - if kwargs['app'] != 'demo': - return - - # Check that there isn't already meaningful data in the db that would be clobbered. - # A freshly created databases should contain no images, tags or snippets - # and just two page records: root and homepage. - if Image.objects.count() or Tag.objects.count() or Advert.objects.count() or Page.objects.count() > 2: - return - - # furthermore, if any page has a more specific type than Page, that suggests that meaningful - # data has been added - for page in Page.objects.all(): - if page.specific_class != Page: - return - - import os, shutil - from django.conf import settings - - fixtures_dir = os.path.join(settings.PROJECT_ROOT, 'demo', 'fixtures') - fixture_file = os.path.join(fixtures_dir, 'demo.json') - image_src_dir = os.path.join(fixtures_dir, 'images') - image_dest_dir = os.path.join(settings.MEDIA_ROOT, 'original_images') - - call_command('loaddata', fixture_file, verbosity=0) - - if not os.path.isdir(image_dest_dir): - os.makedirs(image_dest_dir) - - for filename in os.listdir(image_src_dir): - shutil.copy(os.path.join(image_src_dir, filename), image_dest_dir) diff --git a/examples/wagtaildemo/demo/static/demo/css/admin-streamfield-styles.css b/examples/wagtaildemo/demo/static/demo/css/admin-streamfield-styles.css new file mode 100644 index 00000000..2f8ad2b3 --- /dev/null +++ b/examples/wagtaildemo/demo/static/demo/css/admin-streamfield-styles.css @@ -0,0 +1,63 @@ +/* Example styling for an intro field */ + +.fieldname-intro input, +.fieldname-intro textarea, +.fieldname-intro .richtext{ + font-size:1.4em; +} + +/* Example styling for a blockquote block, where labels aren't required */ + +.blockname-pullquote .fields label{ + display:none; +} + +.blockname-pullquote .fields input, +.blockname-pullquote .fields textarea{ + border:0; + background-color:transparent; + padding:0; +} + +.fieldname-quote .input{ + position: relative; + padding-left: 3em; + padding-right: 3em; +} + + .fieldname-quote .input:before, + .fieldname-quote .input:after{ + content: "\201C"; + position: absolute; + font-family: Bitter, Georgia, Serif; + font-size: 5em; + line-height: 1em; + color :#CCC; + } + + .fieldname-quote .input:before{ + left: 0; + } + .fieldname-quote .input:after{ + right: 0; + top: 0; + } + + .fieldname-quote textarea{ + font-size: 2em; + font-family: Bitter, Georgia, Serif; + } + +.fieldname-attribution .field-content{ + margin-left:2em; +} + .fieldname-attribution .input{ + padding-left:1em; + position:relative; + } + .fieldname-attribution .input:before{ + content: "—"; + position: absolute; + left: 0; + + } diff --git a/examples/wagtaildemo/demo/static/demo/css/main.scss b/examples/wagtaildemo/demo/static/demo/css/main.scss index 8382879a..dd83dac3 100644 --- a/examples/wagtaildemo/demo/static/demo/css/main.scss +++ b/examples/wagtaildemo/demo/static/demo/css/main.scss @@ -1,71 +1,162 @@ +$navbar-height: 51px; +$padding-vertical: 15px; +$wagtail-color: rgb(0, 127, 127); +$html-background-color: whitesmoke; + +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); + +html { + background-color: $html-background-color; +} + /* fonts */ body { - font-family: 'Open Sans', Helvetica, Arial, sans-serif; + font-family: 'Open Sans', Helvetica, Arial, sans-serif; } -/* Carousel styling */ -.bx-wrapper { - width: 100%; - margin-left: 0; -} - -.bx-wrapper img { - width: 100%; - height: auto; -} /* body image styles - classes supplied by rich text editor */ .body-content { - width: 100%; - overflow: hidden; - clear: both; - img { - margin-bottom: 2%; - margin-top: 2%; - } + width: 100%; + overflow: hidden; + clear: both; + margin-bottom: 1em; + img { + margin-bottom: 2%; + margin-top: 2%; + } - img.full-width { - width: 100%; - } + img.full-width { + width: 100%; + } - img.left { - width: 45%; - margin-right: 5%; - float: left; - } + img.left{ + width: 45%; + margin-right: 5%; + float: left; + } - img.right { - width: 45%; - margin-left: 5%; - float: right; - } + img.right{ + width: 45%; + margin-left: 5%; + float: right; + } - h2, h3, h4, h5 { - clear: both; - } + h1, h2, h3, h4, h5 { + clear: both; + } } + +.img-wrapper { + margin-bottom: 1em; + position: relative; + + img { + display: block; + width: 100%; + margin-bottom:0; + } + + &.left { + float:left; + width: 45%; + margin-right: 5%; + } + &.right { + float:right; + width: 45%; + margin-left: 5%; + } +} + +.intro{ + font-size:1.4em; +} + +.caption { + padding: 0.2em 1em 0.2em 0.5em; + margin: 0; + font-weight: 400; + background: #F2f2f2; + font-style: italic; + display: inline-block; + z-index: 2; + position: absolute; + bottom: 5px; + left: 5px; + font-size: 0.9em; + max-width: calc(100% - 10px); + + p{ + margin:0 !important; + } +} + +blockquote{ + margin:2em 0; + + span{ + display:block; + color: #AAA; + font-size:0.8em; + } +} + + /* List styling - tweaks to include images */ a.list-group-item { - clear: both; - width: 100%; - overflow: hidden; - .list-group-item-text { - margin-top: 1%; - img { - float: left; - margin-right: 2%; - margin-bottom: 1%; - } - } + clear: both; + width: 100%; + overflow: hidden; + .list-group-item-text { + margin-top: 1%; + img { + float: left; + margin-right: 2%; + margin-bottom: 1%; + } + } } /* Style pager */ .col-sm-4.pages { - text-align: center; + text-align: center; } .col-sm-4.next { - text-align: right; + text-align: right; +} + +.main { + padding-top: $navbar-height + $padding-vertical; + min-height: 700px; +} + +.carousel { + margin-bottom: $padding-vertical; + .carousel-caption { + background-color: transparentize($wagtail-color, 0.4); + padding-top: 0; + .btn { + margin-bottom: 10px; + } + } +} + +p { + text-align: justify; + + &:last-child { + margin-bottom: 0; + } +} + +.advert-list { + margin-top: $padding-vertical; + margin-bottom: 0; + padding: $padding-vertical 0; + background-color: $html-background-color; + border-top: 1px solid darken($html-background-color, 25%); } diff --git a/examples/wagtaildemo/demo/static/demo/css/vendor/images/bx_loader.gif b/examples/wagtaildemo/demo/static/demo/css/vendor/images/bx_loader.gif deleted file mode 100644 index f4ff40ed..00000000 Binary files a/examples/wagtaildemo/demo/static/demo/css/vendor/images/bx_loader.gif and /dev/null differ diff --git a/examples/wagtaildemo/demo/static/demo/css/vendor/images/controls.png b/examples/wagtaildemo/demo/static/demo/css/vendor/images/controls.png deleted file mode 100644 index 28918dde..00000000 Binary files a/examples/wagtaildemo/demo/static/demo/css/vendor/images/controls.png and /dev/null differ diff --git a/examples/wagtaildemo/demo/static/demo/css/vendor/jquery.bxslider.css b/examples/wagtaildemo/demo/static/demo/css/vendor/jquery.bxslider.css deleted file mode 100644 index 3a6588f4..00000000 --- a/examples/wagtaildemo/demo/static/demo/css/vendor/jquery.bxslider.css +++ /dev/null @@ -1,197 +0,0 @@ -/** - * BxSlider v4.0 - Fully loaded, responsive content slider - * http://bxslider.com - * - * Written by: Steven Wanderski, 2012 - * http://stevenwanderski.com - * (while drinking Belgian ales and listening to jazz) - * - * CEO and founder of bxCreative, LTD - * http://bxcreative.com - */ - - -/** RESET AND LAYOUT -===================================*/ - -.bx-wrapper { - position: relative; - margin: 0 auto 60px; - padding: 0; - *zoom: 1; -} - -.bx-wrapper img { - max-width: 100%; - display: block; -} - -/** THEME -===================================*/ - -.bx-wrapper .bx-viewport { - -moz-box-shadow: 0 0 5px #ccc; - -webkit-box-shadow: 0 0 5px #ccc; - box-shadow: 0 0 5px #ccc; - border: solid #fff 5px; - left: -5px; - background: none; -} - -.bx-wrapper .bx-pager, -.bx-wrapper .bx-controls-auto { - position: absolute; - bottom: -30px; - width: 100%; -} - -/* LOADER */ - -.bx-wrapper .bx-loading { - min-height: 50px; - background: url(images/bx_loader.gif) center center no-repeat #fff; - height: 100%; - width: 100%; - position: absolute; - top: 0; - left: 0; - z-index: 2000; -} - -/* PAGER */ - -.bx-wrapper .bx-pager { - text-align: center; - font-size: .85em; - font-family: Arial; - font-weight: bold; - color: #666; - padding-top: 20px; -} - -.bx-wrapper .bx-pager .bx-pager-item, -.bx-wrapper .bx-controls-auto .bx-controls-auto-item { - display: inline-block; - *zoom: 1; - *display: inline; -} - -.bx-wrapper .bx-pager.bx-default-pager a { - background: #666; - text-indent: -9999px; - display: block; - width: 10px; - height: 10px; - margin: 0 5px; - outline: 0; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - -.bx-wrapper .bx-pager.bx-default-pager a:hover, -.bx-wrapper .bx-pager.bx-default-pager a.active { - background: #000; -} - -/* DIRECTION CONTROLS (NEXT / PREV) */ - -.bx-wrapper .bx-prev { - left: 10px; - background: url(images/controls.png) no-repeat 0 -32px; -} - -.bx-wrapper .bx-next { - right: 10px; - background: url(images/controls.png) no-repeat -43px -32px; -} - -.bx-wrapper .bx-prev:hover { - background-position: 0 0; -} - -.bx-wrapper .bx-next:hover { - background-position: -43px 0; -} - -.bx-wrapper .bx-controls-direction a { - position: absolute; - top: 50%; - margin-top: -16px; - outline: 0; - width: 32px; - height: 32px; - text-indent: -9999px; - z-index: 9999; -} - -.bx-wrapper .bx-controls-direction a.disabled { - display: none; -} - -/* AUTO CONTROLS (START / STOP) */ - -.bx-wrapper .bx-controls-auto { - text-align: center; -} - -.bx-wrapper .bx-controls-auto .bx-start { - display: block; - text-indent: -9999px; - width: 10px; - height: 11px; - outline: 0; - background: url(images/controls.png) -86px -11px no-repeat; - margin: 0 3px; -} - -.bx-wrapper .bx-controls-auto .bx-start:hover, -.bx-wrapper .bx-controls-auto .bx-start.active { - background-position: -86px 0; -} - -.bx-wrapper .bx-controls-auto .bx-stop { - display: block; - text-indent: -9999px; - width: 9px; - height: 11px; - outline: 0; - background: url(images/controls.png) -86px -44px no-repeat; - margin: 0 3px; -} - -.bx-wrapper .bx-controls-auto .bx-stop:hover, -.bx-wrapper .bx-controls-auto .bx-stop.active { - background-position: -86px -33px; -} - -/* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */ - -.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager { - text-align: left; - width: 80%; -} - -.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto { - right: 0; - width: 35px; -} - -/* IMAGE CAPTIONS */ - -.bx-wrapper .bx-caption { - position: absolute; - bottom: 0; - left: 0; - background: #666\9; - background: rgba(80, 80, 80, 0.75); - width: 100%; -} - -.bx-wrapper .bx-caption span { - color: #fff; - font-family: Arial; - display: block; - font-size: .85em; - padding: 10px; -} \ No newline at end of file diff --git a/examples/wagtaildemo/demo/static/demo/js/main.js b/examples/wagtaildemo/demo/static/demo/js/main.js index 2685cb54..208cf4fb 100644 --- a/examples/wagtaildemo/demo/static/demo/js/main.js +++ b/examples/wagtaildemo/demo/static/demo/js/main.js @@ -1,8 +1,6 @@ $(document).ready(function(){ - /* Initialise bxSlider */ - $('.bxslider').bxSlider({ - captions: true - }); + // Initializes tooltips + $('[title]').tooltip({container: 'body'}); //Apply img-thumbnail class to body-content images $('.body-content img').addClass("img-thumbnail"); diff --git a/examples/wagtaildemo/demo/static/demo/js/vendor/jquery.bxslider.min.js b/examples/wagtaildemo/demo/static/demo/js/vendor/jquery.bxslider.min.js deleted file mode 100644 index e477b6f6..00000000 --- a/examples/wagtaildemo/demo/static/demo/js/vendor/jquery.bxslider.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * BxSlider v4.1.1 - Fully loaded, responsive content slider - * http://bxslider.com - * - * Copyright 2012, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com - * Written while drinking Belgian ales and listening to jazz - * - * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ - */ -!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('
'),o.viewport=r.parent(),o.loader=t('
'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:v()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:"block"})),o.controls.el=t('
'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).is("img")&&t(this).attr("src",t(this).attr("src")+"?timestamp="+(new Date).getTime()),t(this).load(function(){setTimeout(function(){++n==s&&i()},0)})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(p()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",B),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&I(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},p=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},v=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('
'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.delegate("a","click",q)},C=function(){o.controls.next=t(''+o.settings.nextText+""),o.controls.prev=t(''+o.settings.prevText+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('
'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoEl=t('
'),o.controls.autoEl.delegate(".bx-start","click",k),o.controls.autoEl.delegate(".bx-stop","click",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('
'+e+"
")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},q=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},I=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),"horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},B=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider())};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&I(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",51).fadeIn(o.settings.speed,function(){t(this).css("zIndex",50),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",p()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),I(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",B))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery); \ No newline at end of file diff --git a/examples/wagtaildemo/demo/templates/demo/base.html b/examples/wagtaildemo/demo/templates/demo/base.html index 459c9048..02078806 100644 --- a/examples/wagtaildemo/demo/templates/demo/base.html +++ b/examples/wagtaildemo/demo/templates/demo/base.html @@ -13,18 +13,13 @@ {# External stylesheets #} - - + {# Local static assets such as css, images and javascrpt should be stored at [yourapp]/static/[yourapp]/... #} {% compress css %} - {# Vendor stylesheets stored locally #} - - {# Custom stylesheets #} {# SCSS compilation relies on django compressor #} - {% endcompress %} {% block extra_css %}{% endblock %} {# Override this block in individual templates in order to add stylesheets on a template by template basis #} @@ -59,42 +54,29 @@ {% top_menu parent=site_root calling_page=self %} {% endblock %} -
-
-

Wagtail Demo

-

A set of demo templates to show you what Wagtail can do.

- {% block search_box %} - {% include "demo/includes/search_box.html" only %} - {% endblock %} -
+
+ + {% breadcrumbs %} {% block heading %} {% endblock %} - {% block content %} + {% block content %}{% endblock %} - {% endblock %} - - {% block secondary_menu %} - {% secondary_menu calling_page=self %} - {% endblock %} - - {% block adverts %} - {# Uses a snippet - allows adverts to appear on every page #} - {% adverts %} - {% endblock %} + {% include 'demo/includes/prev_next.html' %}
+ {% adverts %} + {# External javascript #} - - + + {% compress js %} - {# Custom javascript #} {# Local static assets such as css, images and javascrpt should be stored at [yourapp]/static/[yourapp]/... #} diff --git a/examples/wagtaildemo/demo/templates/demo/blog_index_page.html b/examples/wagtaildemo/demo/templates/demo/blog_index_page.html index 7a9e8a64..91f97a05 100644 --- a/examples/wagtaildemo/demo/templates/demo/blog_index_page.html +++ b/examples/wagtaildemo/demo/templates/demo/blog_index_page.html @@ -6,7 +6,7 @@ {% include "demo/includes/intro.html" with intro=self.intro only %} {% if request.GET.tag|length %} -

Showing posts tagged as {{ request.GET.tag|safe }} Show all

+

Showing posts tagged as {{ request.GET.tag }} Show all

{% endif %}
@@ -38,4 +38,4 @@
{% include "demo/includes/related_links.html" with related_links=self.related_links.all only %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/examples/wagtaildemo/demo/templates/demo/blog_page.html b/examples/wagtaildemo/demo/templates/demo/blog_page.html index 306fad1a..59da38ed 100644 --- a/examples/wagtaildemo/demo/templates/demo/blog_page.html +++ b/examples/wagtaildemo/demo/templates/demo/blog_page.html @@ -2,27 +2,34 @@ {% load wagtailcore_tags %} -{% if self.date %} - {% block heading %} - - {% endblock %} -{% endif %} +{% block heading %} + +{% endblock %} {% block content %} {% include "demo/includes/carousel.html" with carousel_items=self.carousel_items.all only %} - {% include "demo/includes/body.html" with body=self.body only %} - - {% with self.tags.all as tags %} - {% if tags %} - - {% for tag in tags %} - - {% endfor %} - {% endif %} - {% endwith %} + {% if self.body %} +
+ {% include "demo/includes/streamfield.html" with content=self.body %} +
+ {% endif %} {% include "demo/includes/related_links.html" with related_links=self.related_links.all only %} {% endblock %} diff --git a/examples/wagtaildemo/demo/templates/demo/contact_page.html b/examples/wagtaildemo/demo/templates/demo/contact_page.html index 8f631e27..2cdb993b 100644 --- a/examples/wagtaildemo/demo/templates/demo/contact_page.html +++ b/examples/wagtaildemo/demo/templates/demo/contact_page.html @@ -1,19 +1,22 @@ {% extends "demo/base.html" %} -{% load demo_tags %} +{% load demo_tags wagtailcore_tags %} {% block content %} - {% include "demo/includes/body.html" with body=self.body only %} + {% if self.body %} +
+ {{ self.body|richtext }} +
+ {% endif %} {% include "demo/includes/contact.html" with contact=self only %} {% if self.post_code %} - - {% get_googe_maps_key as google_maps_key %} - + {% get_google_maps_key as google_maps_key %} - - {% endif %} + + + + {% endif %} {% endblock %} diff --git a/examples/wagtaildemo/demo/templates/demo/event_page.html b/examples/wagtaildemo/demo/templates/demo/event_page.html index bc6dd0f6..50732eb2 100644 --- a/examples/wagtaildemo/demo/templates/demo/event_page.html +++ b/examples/wagtaildemo/demo/templates/demo/event_page.html @@ -4,8 +4,8 @@ {% block content %}

- {{ self.date_from|date:"j F Y" }}{% if self.date_to %} to {{ self.date_to|date:"j F Y" }}{% endif %} - {% if self.time_from %}{{ self.time_from|time_display }}{% endif %}{% if self.time_to %} to {{ self.time_to|time_display }}{% endif %} + {{ self.date_from }}{% if self.date_to %} to {{ self.date_to }}{% endif %} + {% if self.time_from %}{{ self.time_from|time }}{% endif %}{% if self.time_to %} to {{ self.time_to|time }}{% endif %}

{% if self.location %}

Location: {{ self.location }}

{% endif %} {% if self.audience %} @@ -14,7 +14,7 @@ {{ self.get_audience_display }}

{% endif %} {% if self.cost %} -

Cost: {{ self.cost|safe }}

+

Cost: {{ self.cost }}

{% endif %} {% if self.signup_link %} @@ -30,7 +30,11 @@ {% include "demo/includes/carousel.html" with carousel_items=self.carousel_items.all only %} - {% include "demo/includes/body.html" with body=self.body only %} + {% if self.body %} +
+ {{ self.body|richtext }} +
+ {% endif %} {% with self.speakers.all as speakers %} {% if speakers %} diff --git a/examples/wagtaildemo/demo/templates/demo/home_page.html b/examples/wagtaildemo/demo/templates/demo/home_page.html index 1ca1cfaf..929ac55d 100644 --- a/examples/wagtaildemo/demo/templates/demo/home_page.html +++ b/examples/wagtaildemo/demo/templates/demo/home_page.html @@ -2,10 +2,25 @@ {% load demo_tags %} +{% block heading %} +
+

Wagtail Demo

+

A set of demo templates to show you what Wagtail can do.

+ {% block search_box %} + {% include "demo/includes/search_box.html" only %} + {% endblock %} +
+{% endblock %} + + {% block content %} {% include "demo/includes/carousel.html" with carousel_items=self.carousel_items.all only %} - {% include "demo/includes/body.html" with body=self.body only %} + {% if self.body %} +
+ {% include "demo/includes/streamfield.html" with content=self.body %} +
+ {% endif %} {% person_listing_homepage %} diff --git a/examples/wagtaildemo/demo/templates/demo/includes/blog_list_item.html b/examples/wagtaildemo/demo/templates/demo/includes/blog_list_item.html index 09d528a5..42563aa7 100644 --- a/examples/wagtaildemo/demo/templates/demo/includes/blog_list_item.html +++ b/examples/wagtaildemo/demo/templates/demo/includes/blog_list_item.html @@ -2,16 +2,19 @@ {# Individual blog item in a list - used on blog index and home page #} -

{{ blog.title }}

-

{{ blog.date|date:"j F Y" }}

- {% if blog.search_description or blog.feed_image %} -

- {% if blog.feed_image %} - {% image blog.feed_image width-200 %} - {% endif %} - {% if blog.search_description %} - {{ blog.search_description }} - {% endif %} -

+
+ {% if blog.feed_image %} +
+ {% image blog.feed_image width-200 as img %} + +
{% endif %} -
\ No newline at end of file +
+

{{ blog.title }}

+

{{ blog.date }}

+ {% if blog.search_description %} +

{{ blog.search_description }}

+ {% endif %} +
+
+ diff --git a/examples/wagtaildemo/demo/templates/demo/includes/body.html b/examples/wagtaildemo/demo/templates/demo/includes/body.html deleted file mode 100644 index 231f0497..00000000 --- a/examples/wagtaildemo/demo/templates/demo/includes/body.html +++ /dev/null @@ -1,7 +0,0 @@ -{% load wagtailcore_tags %} - -{% if body %} -
- {{ body|richtext }} -
-{% endif %} \ No newline at end of file diff --git a/examples/wagtaildemo/demo/templates/demo/includes/carousel.html b/examples/wagtaildemo/demo/templates/demo/includes/carousel.html index d884c96d..6f1771ca 100644 --- a/examples/wagtaildemo/demo/templates/demo/includes/carousel.html +++ b/examples/wagtaildemo/demo/templates/demo/includes/carousel.html @@ -1,20 +1,50 @@ {% load wagtailimages_tags wagtailembeds_tags %} + {% if carousel_items %} - + + {% endif %} + + + + {% if carousel_items|length > 1 %} + + + Previous + + + + Next + + {% endif %} +
{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/includes/event_list_item.html b/examples/wagtaildemo/demo/templates/demo/includes/event_list_item.html index 583a3e9e..b33893af 100644 --- a/examples/wagtaildemo/demo/templates/demo/includes/event_list_item.html +++ b/examples/wagtaildemo/demo/templates/demo/includes/event_list_item.html @@ -2,16 +2,19 @@ {# Individual event item in a list - used on event index and home page #} -

{{ event.title }}

-

{{ event.date_from|date:"j F Y" }}{% if event.date_to %} to {{ event.date_to|date:"j F Y" }}{% endif %}

- {% if event.search_description or event.feed_image %} -

- {% if event.feed_image %} - {% image event.feed_image width-200 %} - {% endif %} - {% if event.search_description %} - {{ event.search_description }} - {% endif %} -

+
+ {% if event.feed_image %} +
+ {% image event.feed_image width-200 as img %} + +
{% endif %} -
\ No newline at end of file +
+

{{ event.title }}

+

{{ event.date_from }}{% if event.date_to %} to {{ event.date_to }}{% endif %}

+ {% if event.search_description %} +

{{ event.search_description }}

+ {% endif %} +
+
+ diff --git a/examples/wagtaildemo/demo/templates/demo/includes/person_list_item.html b/examples/wagtaildemo/demo/templates/demo/includes/person_list_item.html new file mode 100644 index 00000000..6c2f2ed1 --- /dev/null +++ b/examples/wagtaildemo/demo/templates/demo/includes/person_list_item.html @@ -0,0 +1,19 @@ +{% load wagtailcore_tags wagtailimages_tags %} + +{# Individual person item in a list - used on people index and home page #} + +
+ {% if person.feed_image %} +
+ {% image person.feed_image width-200 as img %} + +
+ {% endif %} +
+

{{ person.first_name }} {{ person.last_name }}

+ {% if person.search_description %} +

{{ person.search_description }}

+ {% endif %} +
+
+
diff --git a/examples/wagtaildemo/demo/templates/demo/includes/prev_next.html b/examples/wagtaildemo/demo/templates/demo/includes/prev_next.html new file mode 100644 index 00000000..34100151 --- /dev/null +++ b/examples/wagtaildemo/demo/templates/demo/includes/prev_next.html @@ -0,0 +1,22 @@ +{% load wagtailcore_tags %} + +{% if self.depth > 3 %}{# Previous and next buttons are not relevant for the home page and categories #} + {% with prev=self.get_prev_siblings.live.first next=self.get_next_siblings.live.first %} + + {% endwith %} +{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/includes/search_box.html b/examples/wagtaildemo/demo/templates/demo/includes/search_box.html index 68b93886..568f4bb4 100644 --- a/examples/wagtaildemo/demo/templates/demo/includes/search_box.html +++ b/examples/wagtaildemo/demo/templates/demo/includes/search_box.html @@ -1,4 +1,14 @@ -
- - -
\ No newline at end of file +
+
+
+
+ +
+ +
+
+
+
+
diff --git a/examples/wagtaildemo/demo/templates/demo/includes/streamfield.html b/examples/wagtaildemo/demo/templates/demo/includes/streamfield.html new file mode 100644 index 00000000..64928512 --- /dev/null +++ b/examples/wagtaildemo/demo/templates/demo/includes/streamfield.html @@ -0,0 +1,46 @@ +{% load wagtailcore_tags wagtailimages_tags %} + +
+ {% for child in content %} + {% if child.block_type == 'h2' %} +

{{ child }}

+ {% elif child.block_type == 'h3' %} +

{{ child }}

+ {% elif child.block_type == 'h4' %} +

{{ child }}

+ {% elif child.block_type == 'intro' %} +
{{ child }}
+ {% elif child.block_type == 'aligned_html' %} + {% if child.value.alignment == 'normal' %} + {{ child.value.bound_blocks.html.render }} + {% else %} + {{ child.value.bound_blocks.html.render }} + {% endif %} + {% elif child.block_type == 'pullquote' %} +
+ {{ child.value.quote }} + {% if child.value.attribution %}- {{ child.value.attribution }}{% endif %} +
+ {% elif child.block_type == 'paragraph' %} + {{ child.value|richtext }} + {% elif child.block_type == 'aligned_image' %} +
+ {% if child.value.alignment == "left" or child.value.alignment == "right" %} + {% image child.value.image width-300 as theimage %} + {% else %} + {% image child.value.image width-1280 as theimage %} + {% endif %} + + {{ theimage.alt }} + + {% if child.value.caption %} +
+ {{ child.value.caption|richtext }} +
+ {% endif %} +
+ {% else %} + {{ child }} + {% endif %} + {% endfor %} +
\ No newline at end of file diff --git a/examples/wagtaildemo/demo/templates/demo/person_page.html b/examples/wagtaildemo/demo/templates/demo/person_page.html index 6c8496fb..944ffbfe 100644 --- a/examples/wagtaildemo/demo/templates/demo/person_page.html +++ b/examples/wagtaildemo/demo/templates/demo/person_page.html @@ -1,20 +1,22 @@ {% extends "demo/base.html" %} -{% load wagtailimages_tags %} +{% load wagtailcore_tags wagtailimages_tags %} {% block content %} {% include "demo/includes/intro.html" with intro=self.intro only %} {% if self.image %} - {# Person image - first store image as a variable in order to construct an image tag with a class applied #} - {% image self.image width-300 as photo %} - {{ photo.alt }} + {% image self.image width-300 class="img-thumbnail" %} {% endif %} {% if self.biography %} {% endif %} - {% include "demo/includes/body.html" with body=self.biography only %} + {% if self.body %} +
+ {{ self.body|richtext }} +
+ {% endif %} {% include "demo/includes/contact.html" with contact=self only %} diff --git a/examples/wagtaildemo/demo/templates/demo/search_results.html b/examples/wagtaildemo/demo/templates/demo/search_results.html index 22c637c0..31a02c81 100644 --- a/examples/wagtaildemo/demo/templates/demo/search_results.html +++ b/examples/wagtaildemo/demo/templates/demo/search_results.html @@ -1,41 +1,44 @@ {% extends "demo/base.html" %} {% load wagtailcore_tags %} -{% block title %}Search{% if search_results %} Results{% endif %}{% endblock %} +{% block title %}Search{% if search_results %} results{% endif %}{% endblock %} -{% block search_box %} - {% include "demo/includes/search_box.html" with query_string=query_string only %} +{% block heading %} +

+ Search results{% if request.GET.query %} for “{{ request.GET.query }}”{% endif %} +

{% endblock %} + {% block content %} -

Search Results{% if request.GET.q %} for {{ request.GET.q }}{% endif %}

- - {% with query.editors_picks.all as editors_picks %} - {% if editors_picks %} -
+ {% if search_picks %} +

Editors picks

- -
- {% endif %} - {% endwith %} + +
+ {% endif %} -
    - {% for result in search_results %} -
  • -

    {{ result.specific }}

    - {% if result.specific.search_description %} - {{ result.specific.search_description|safe }} - {% endif %} -
  • - {% empty %} -
  • No results found
  • - {% endfor %} -
+ {% if search_results %} +
    + {% for result in search_results %} +
  • +

    {{ result.specific }}

    + {% if result.specific.search_description %} + {{ result.specific.search_description }} + {% endif %} +
  • + {% endfor %} +
+ {% elif search_query %} + No results found + {% else %} + You didn’t search anything! + {% endif %} {% endblock %} diff --git a/examples/wagtaildemo/demo/templates/demo/standard_page.html b/examples/wagtaildemo/demo/templates/demo/standard_page.html index 0d443ac3..f59ed434 100644 --- a/examples/wagtaildemo/demo/templates/demo/standard_page.html +++ b/examples/wagtaildemo/demo/templates/demo/standard_page.html @@ -1,11 +1,17 @@ {% extends "demo/base.html" %} +{% load wagtailcore_tags %} + {% block content %} {% include "demo/includes/intro.html" with intro=self.intro only %} {% include "demo/includes/carousel.html" with carousel_items=self.carousel_items.all only %} - {% include "demo/includes/body.html" with body=self.body only %} + {% if self.body %} +
+ {{ self.body|richtext }} +
+ {% endif %} {% include "demo/includes/related_links.html" with related_links=self.related_links.all only %} {% endblock %} diff --git a/examples/wagtaildemo/demo/templates/demo/tags/adverts.html b/examples/wagtaildemo/demo/templates/demo/tags/adverts.html index 806eed3f..36e2d402 100644 --- a/examples/wagtaildemo/demo/templates/demo/tags/adverts.html +++ b/examples/wagtaildemo/demo/templates/demo/tags/adverts.html @@ -1,6 +1,18 @@ {% load wagtailcore_tags %} -{% for advert in adverts %} - {% if advert.url %}{% elif advert.page %}{% endif %} -

{{ advert.text }}

- {% if advert.url or advert.page %}
{% endif %} -{% endfor %} \ No newline at end of file + +{% if adverts %} + +{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/tags/blog_listing_homepage.html b/examples/wagtaildemo/demo/templates/demo/tags/blog_listing_homepage.html index f7b180f8..7873b0b5 100644 --- a/examples/wagtaildemo/demo/templates/demo/tags/blog_listing_homepage.html +++ b/examples/wagtaildemo/demo/templates/demo/tags/blog_listing_homepage.html @@ -1,8 +1,10 @@ {% if blogs %} - +
+

Recent blog posts

- {% for blog in blogs %} - {% include "demo/includes/blog_list_item.html" %} - {% endfor %} + {% for blog in blogs %} + {% include "demo/includes/blog_list_item.html" %} + {% endfor %}
+
{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/tags/breadcrumbs.html b/examples/wagtaildemo/demo/templates/demo/tags/breadcrumbs.html new file mode 100644 index 00000000..b75cc276 --- /dev/null +++ b/examples/wagtaildemo/demo/templates/demo/tags/breadcrumbs.html @@ -0,0 +1,13 @@ +{% load wagtailcore_tags %} + +{% if ancestors %} + +{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/tags/event_listing_homepage.html b/examples/wagtaildemo/demo/templates/demo/tags/event_listing_homepage.html index 5c19dc31..8e6c54e2 100644 --- a/examples/wagtaildemo/demo/templates/demo/tags/event_listing_homepage.html +++ b/examples/wagtaildemo/demo/templates/demo/tags/event_listing_homepage.html @@ -1,8 +1,10 @@ {% if events %} - +
+

Upcoming events

- {% for event in events %} - {% include "demo/includes/event_list_item.html" %} - {% endfor %} + {% for event in events %} + {% include "demo/includes/event_list_item.html" %} + {% endfor %}
+
{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/tags/person_listing_homepage.html b/examples/wagtaildemo/demo/templates/demo/tags/person_listing_homepage.html index 4eeb5ed4..d8fd3636 100644 --- a/examples/wagtaildemo/demo/templates/demo/tags/person_listing_homepage.html +++ b/examples/wagtaildemo/demo/templates/demo/tags/person_listing_homepage.html @@ -1,21 +1,10 @@ -{% load wagtailcore_tags wagtailimages_tags %} {% if people %} - -
- {% for person in people %} - -

{{ person.first_name }} {{ person.last_name }}

- {% if person.search_description or person.image %} -

- {% if person.image %} - {% image person.feed_image width-200 %} - {% endif %} - {% if person.search_description %} - {{ person.search_description }} - {% endif %} -

- {% endif %} -
- {% endfor %} +
+

People

+
+ {% for person in people %} + {% include "demo/includes/person_list_item.html" %} + {% endfor %}
-{% endif %} \ No newline at end of file +
+{% endif %} diff --git a/examples/wagtaildemo/demo/templates/demo/tags/secondary_menu.html b/examples/wagtaildemo/demo/templates/demo/tags/secondary_menu.html deleted file mode 100644 index 1034707e..00000000 --- a/examples/wagtaildemo/demo/templates/demo/tags/secondary_menu.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load wagtailcore_tags %} - -{% if pages %} - -
-
-
-
-

Also in this section

-
-
- -
-
-
-
-{% endif %} - \ No newline at end of file diff --git a/examples/wagtaildemo/demo/templates/demo/tags/top_menu.html b/examples/wagtaildemo/demo/templates/demo/tags/top_menu.html index 3c847d11..6550772b 100644 --- a/examples/wagtaildemo/demo/templates/demo/tags/top_menu.html +++ b/examples/wagtaildemo/demo/templates/demo/tags/top_menu.html @@ -12,12 +12,14 @@ {# Link to home page #} - {{ site_root.title }} + + +
diff --git a/examples/wagtaildemo/demo/templatetags/demo_tags.py b/examples/wagtaildemo/demo/templatetags/demo_tags.py index 63695109..21ad7aa9 100644 --- a/examples/wagtaildemo/demo/templatetags/demo_tags.py +++ b/examples/wagtaildemo/demo/templatetags/demo_tags.py @@ -2,14 +2,14 @@ from datetime import date from django import template from django.conf import settings -from demo.models import * +from demo.models import PersonPage, BlogPage, EventPage, Advert, Page register = template.Library() # settings value @register.assignment_tag -def get_googe_maps_key(): +def get_google_maps_key(): return getattr(settings, 'GOOGLE_MAPS_KEY', "") @@ -21,10 +21,7 @@ def get_site_root(context): def has_menu_children(page): - if page.get_children().filter(live=True, show_in_menus=True): - return True - else: - return False + return page.get_children().live().in_menu().exists() # Retrieves the top menu items - the immediate children of the parent page @@ -32,12 +29,14 @@ def has_menu_children(page): # a dropdown class to be applied to a parent @register.inclusion_tag('demo/tags/top_menu.html', takes_context=True) def top_menu(context, parent, calling_page=None): - menuitems = parent.get_children().filter( - live=True, - show_in_menus=True - ) + menuitems = parent.get_children().live().in_menu() for menuitem in menuitems: menuitem.show_dropdown = has_menu_children(menuitem) + # We don't directly check if calling_page is None since the template + # engine can pass an empty string to calling_page + # if the variable passed as calling_page does not exist. + menuitem.active = (calling_page.url.startswith(menuitem.url) + if calling_page else False) return { 'calling_page': calling_page, 'menuitems': menuitems, @@ -50,10 +49,7 @@ def top_menu(context, parent, calling_page=None): @register.inclusion_tag('demo/tags/top_menu_children.html', takes_context=True) def top_menu_children(context, parent): menuitems_children = parent.get_children() - menuitems_children = menuitems_children.filter( - live=True, - show_in_menus=True - ) + menuitems_children = menuitems_children.live().in_menu() return { 'parent': parent, 'menuitems_children': menuitems_children, @@ -62,30 +58,6 @@ def top_menu_children(context, parent): } -# Retrieves the secondary links for the 'also in this section' links -# - either the children or siblings of the current page -@register.inclusion_tag('demo/tags/secondary_menu.html', takes_context=True) -def secondary_menu(context, calling_page=None): - pages = [] - if calling_page: - pages = calling_page.get_children().filter( - live=True, - show_in_menus=True - ) - - # If no children, get siblings instead - if len(pages) == 0: - pages = calling_page.get_siblings(inclusive=False).filter( - live=True, - show_in_menus=True - ) - return { - 'pages': pages, - # required by the pageurl tag that we want to use within this template - 'request': context['request'], - } - - # Retrieves all live pages which are children of the calling page #for standard index listing @register.inclusion_tag( @@ -93,7 +65,7 @@ def secondary_menu(context, calling_page=None): takes_context=True ) def standard_index_listing(context, calling_page): - pages = calling_page.get_children().filter(live=True) + pages = calling_page.get_children().live() return { 'pages': pages, # required by the pageurl tag that we want to use within this template @@ -107,9 +79,9 @@ def standard_index_listing(context, calling_page): takes_context=True ) def person_listing_homepage(context, count=2): - people = PersonPage.objects.filter(live=True).order_by('?') + people = PersonPage.objects.live().order_by('?') return { - 'people': people[:count], + 'people': people[:count].select_related('feed_image'), # required by the pageurl tag that we want to use within this template 'request': context['request'], } @@ -121,9 +93,9 @@ def person_listing_homepage(context, count=2): takes_context=True ) def blog_listing_homepage(context, count=2): - blogs = BlogPage.objects.filter(live=True).order_by('-date') + blogs = BlogPage.objects.live().order_by('-date') return { - 'blogs': blogs[:count], + 'blogs': blogs[:count].select_related('feed_image'), # required by the pageurl tag that we want to use within this template 'request': context['request'], } @@ -135,10 +107,10 @@ def blog_listing_homepage(context, count=2): takes_context=True ) def event_listing_homepage(context, count=2): - events = EventPage.objects.filter(live=True) + events = EventPage.objects.live() events = events.filter(date_from__gte=date.today()).order_by('date_from') return { - 'events': events[:count], + 'events': events[:count].select_related('feed_image'), # required by the pageurl tag that we want to use within this template 'request': context['request'], } @@ -148,41 +120,21 @@ def event_listing_homepage(context, count=2): @register.inclusion_tag('demo/tags/adverts.html', takes_context=True) def adverts(context): return { - 'adverts': Advert.objects.all(), + 'adverts': Advert.objects.select_related('page'), 'request': context['request'], } -# Format times e.g. on event page -@register.filter -def time_display(time): - # Get hour and minute from time object - hour = time.hour - minute = time.minute - - # Convert to 12 hour format - if hour >= 12: - pm = True - hour -= 12 +@register.inclusion_tag('demo/tags/breadcrumbs.html', takes_context=True) +def breadcrumbs(context): + self = context.get('self') + if self is None or self.depth <= 2: + # When on the home page, displaying breadcrumbs is irrelevant. + ancestors = () else: - pm = False - if hour == 0: - hour = 12 - - # Hour string - hour_string = str(hour) - - # Minute string - if minute != 0: - minute_string = "." + str(minute) - else: - minute_string = "" - - # PM string - if pm: - pm_string = "pm" - else: - pm_string = "am" - - # Join and return - return "".join([hour_string, minute_string, pm_string]) + ancestors = Page.objects.ancestor_of( + self, inclusive=True).filter(depth__gt=2) + return { + 'ancestors': ancestors, + 'request': context['request'], + } diff --git a/examples/wagtaildemo/demo/utils.py b/examples/wagtaildemo/demo/utils.py index 1f170cb6..ff7a4a99 100644 --- a/examples/wagtaildemo/demo/utils.py +++ b/examples/wagtaildemo/demo/utils.py @@ -52,7 +52,8 @@ def export_event(event, format='ical'): return string # Make a uid - uid = hashlib.sha1(event.url + str(start_datetime)).hexdigest() + '@wagtaildemo' + event_string = event.url + str(start_datetime) + uid = hashlib.sha1(event_string.encode('utf-8')).hexdigest() + '@wagtaildemo' # Make event ical_components.extend([ diff --git a/examples/wagtaildemo/demo/views.py b/examples/wagtaildemo/demo/views.py new file mode 100644 index 00000000..18decec6 --- /dev/null +++ b/examples/wagtaildemo/demo/views.py @@ -0,0 +1,45 @@ +from django.shortcuts import render +from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger + +from wagtail.wagtailcore.models import Page +from wagtail.wagtailsearch.models import Query + +try: + # Wagtail >= 1.1 + from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion +except ImportError: + # Wagtail < 1.1 + from wagtail.wagtailsearch.models import EditorsPick as SearchPromotion + + +def search(request): + # Search + search_query = request.GET.get('query', None) + if search_query: + search_results = Page.objects.live().search(search_query) + query = Query.get(search_query) + + # Record hit + query.add_hit() + + # Get search picks + search_picks = query.editors_picks.all() + else: + search_results = Page.objects.none() + search_picks = SearchPromotion.objects.none() + + # Pagination + page = request.GET.get('page', 1) + paginator = Paginator(search_results, 10) + try: + search_results = paginator.page(page) + except PageNotAnInteger: + search_results = paginator.page(1) + except EmptyPage: + search_results = paginator.page(paginator.num_pages) + + return render(request, 'demo/search_results.html', { + 'search_query': search_query, + 'search_results': search_results, + 'search_picks': search_picks, + }) diff --git a/examples/wagtaildemo/demo/wagtail_hooks.py b/examples/wagtaildemo/demo/wagtail_hooks.py new file mode 100644 index 00000000..f0d05146 --- /dev/null +++ b/examples/wagtaildemo/demo/wagtail_hooks.py @@ -0,0 +1,8 @@ +from django.utils.html import format_html +from django.conf import settings + +from wagtail.wagtailcore import hooks + +@hooks.register('insert_editor_css') +def editor_css(): + return format_html('') diff --git a/examples/wagtaildemo/etc/install/bashrc b/examples/wagtaildemo/etc/install/bashrc deleted file mode 100644 index 120a7c1f..00000000 --- a/examples/wagtaildemo/etc/install/bashrc +++ /dev/null @@ -1,106 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -[ -z "$PS1" ] && return - -# don't put duplicate lines in the history. See bash(1) for more options -# ... or force ignoredups and ignorespace -HISTCONTROL=ignoredups:ignorespace - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -#force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if [ -f /etc/bash_completion ] && ! shopt -oq posix; then - . /etc/bash_completion -fi - -export WORKON_HOME=$HOME/.virtualenvs -export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache -source /usr/local/bin/virtualenvwrapper.sh - -alias dj="/home/vagrant/.virtualenvs/wagtaildemo/bin/python /home/vagrant/wagtaildemo/manage.py" -alias djrun="dj runserver 0.0.0.0:8000" diff --git a/examples/wagtaildemo/etc/install/etc-bash.bashrc b/examples/wagtaildemo/etc/install/etc-bash.bashrc deleted file mode 100644 index 00d0a7bb..00000000 --- a/examples/wagtaildemo/etc/install/etc-bash.bashrc +++ /dev/null @@ -1,68 +0,0 @@ -# System-wide .bashrc file for interactive bash(1) shells. - -# To enable the settings / commands in this file for login shells as well, -# this file has to be sourced in /etc/profile. - -# If not running interactively, don't do anything -[ -z "$PS1" ] && return - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, overwrite the one in /etc/profile) -PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' - -# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default. -# If this is an xterm set the title to user@host:dir -#case "$TERM" in -#xterm*|rxvt*) -# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' -# ;; -#*) -# ;; -#esac - -# enable bash completion in interactive shells -#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then -# . /etc/bash_completion -#fi - -# sudo hint -if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then - case " $(groups) " in *\ admin\ *) - if [ -x /usr/bin/sudo ]; then - cat <<-EOF - To run a command as administrator (user "root"), use "sudo ". - See "man sudo_root" for details. - - EOF - fi - esac -fi - -# if the command-not-found package is installed, use it -if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then - function command_not_found_handle { - # check because c-n-f could've been removed in the meantime - if [ -x /usr/lib/command-not-found ]; then - /usr/bin/python /usr/lib/command-not-found -- "$1" - return $? - elif [ -x /usr/share/command-not-found/command-not-found ]; then - /usr/bin/python /usr/share/command-not-found/command-not-found -- "$1" - return $? - else - printf "%s: command not found\n" "$1" >&2 - return 127 - fi - } -fi - -export LANGUAGE=en_GB.UTF-8 -export LANG=en_GB.UTF-8 -export LC_ALL=en_GB.UTF-8 diff --git a/examples/wagtaildemo/etc/install/install.sh b/examples/wagtaildemo/etc/install/install.sh deleted file mode 100644 index b72b3035..00000000 --- a/examples/wagtaildemo/etc/install/install.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -# Script to set up a Django project on Vagrant. - -# Installation settings - -PROJECT_NAME=$1 - -DB_NAME=$PROJECT_NAME -VIRTUALENV_NAME=$PROJECT_NAME - -PROJECT_DIR=/home/vagrant/$PROJECT_NAME -VIRTUALENV_DIR=/home/vagrant/.virtualenvs/$PROJECT_NAME - -PGSQL_VERSION=9.1 - -# Need to fix locale so that Postgres creates databases in UTF-8 -cp -p $PROJECT_DIR/etc/install/etc-bash.bashrc /etc/bash.bashrc -locale-gen en_GB.UTF-8 -dpkg-reconfigure locales - -export LANGUAGE=en_GB.UTF-8 -export LANG=en_GB.UTF-8 -export LC_ALL=en_GB.UTF-8 - -# Install essential packages from Apt -apt-get update -y -# Python dev packages -apt-get install -y build-essential python python-dev python-setuptools python-pip -# Dependencies for image processing with Pillow (drop-in replacement for PIL) -# supporting: jpeg, tiff, png, freetype, littlecms -# (pip install pillow to get pillow itself) -apt-get install -y libjpeg-dev libtiff-dev zlib1g-dev libfreetype6-dev liblcms2-dev -# Git (we'd rather avoid people keeping credentials for git commits in the repo, but sometimes we need it for pip requirements that aren't in PyPI) -apt-get install -y git - -# Optional: install redis (recommended for production sites as a backend -# for Celery and Django cache) -# -# apt-get install -y redis-server - -# Postgresql -if ! command -v psql; then - apt-get install -y postgresql-$PGSQL_VERSION libpq-dev - cp $PROJECT_DIR/etc/install/pg_hba.conf /etc/postgresql/$PGSQL_VERSION/main/ - /etc/init.d/postgresql reload -fi - -# virtualenv global setup -easy_install -U pip -pip install virtualenv virtualenvwrapper stevedore virtualenv-clone - - -# bash environment global setup -cp -p $PROJECT_DIR/etc/install/bashrc /home/vagrant/.bashrc -su - vagrant -c "mkdir -p /home/vagrant/.pip_download_cache" - -# --- - -# Optional: install ElasticSearch (for higher-performance / more flexible search functionality) -# -# if ! command -v /usr/share/elasticsearch/bin/elasticsearch; then -# apt-get install -y openjdk-7-jre-headless -# echo "Downloading ElasticSearch..." -# wget -q https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.1.deb -# dpkg -i elasticsearch-1.2.1.deb -# service elasticsearch start -# fi - -# postgresql setup for project -createdb -Upostgres $DB_NAME - -# dependencies for lxml (for HTML whitelisting) -apt-get install -y libxml2-dev libxslt-dev - -# virtualenv setup for project -su - vagrant -c "/usr/local/bin/virtualenv $VIRTUALENV_DIR && \ - echo $PROJECT_DIR > $VIRTUALENV_DIR/.project && \ - PIP_DOWNLOAD_CACHE=/home/vagrant/.pip_download_cache $VIRTUALENV_DIR/bin/pip install -r $PROJECT_DIR/requirements/dev.txt" - -echo "workon $VIRTUALENV_NAME" >> /home/vagrant/.bashrc - -# Set execute permissions on manage.py, as they get lost if we build from a zip file -chmod a+x $PROJECT_DIR/manage.py - -# Django project setup -su - vagrant -c "source $VIRTUALENV_DIR/bin/activate && cd $PROJECT_DIR && python manage.py syncdb --noinput && python manage.py migrate --noinput" diff --git a/examples/wagtaildemo/etc/install/pg_hba.conf b/examples/wagtaildemo/etc/install/pg_hba.conf deleted file mode 100644 index 8564a9b1..00000000 --- a/examples/wagtaildemo/etc/install/pg_hba.conf +++ /dev/null @@ -1,89 +0,0 @@ -# PostgreSQL Client Authentication Configuration File -# =================================================== -# -# Refer to the "Client Authentication" section in the -# PostgreSQL documentation for a complete description -# of this file. A short synopsis follows. -# -# This file controls: which hosts are allowed to connect, how clients -# are authenticated, which PostgreSQL user names they can use, which -# databases they can access. Records take one of these forms: -# -# local DATABASE USER METHOD [OPTIONS] -# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] -# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] -# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] -# -# (The uppercase items must be replaced by actual values.) -# -# The first field is the connection type: "local" is a Unix-domain socket, -# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an -# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket. -# -# DATABASE can be "all", "sameuser", "samerole", a database name, or -# a comma-separated list thereof. -# -# USER can be "all", a user name, a group name prefixed with "+", or -# a comma-separated list thereof. In both the DATABASE and USER fields -# you can also write a file name prefixed with "@" to include names from -# a separate file. -# -# CIDR-ADDRESS specifies the set of hosts the record matches. -# It is made up of an IP address and a CIDR mask that is an integer -# (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies -# the number of significant bits in the mask. Alternatively, you can write -# an IP address and netmask in separate columns to specify the set of hosts. -# -# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", "krb5", -# "ident", "pam", "ldap" or "cert". Note that "password" sends passwords -# in clear text; "md5" is preferred since it sends encrypted passwords. -# -# OPTIONS are a set of options for the authentication in the format -# NAME=VALUE. The available options depend on the different authentication -# methods - refer to the "Client Authentication" section in the documentation -# for a list of which options are available for which authentication methods. -# -# Database and user names containing spaces, commas, quotes and other special -# characters must be quoted. Quoting one of the keywords "all", "sameuser" or -# "samerole" makes the name lose its special character, and just match a -# database or username with that name. -# -# This file is read on server startup and when the postmaster receives -# a SIGHUP signal. If you edit the file on a running system, you have -# to SIGHUP the postmaster for the changes to take effect. You can use -# "pg_ctl reload" to do that. - -# Put your actual configuration here -# ---------------------------------- -# -# If you want to allow non-local connections, you need to add more -# "host" records. In that case you will also need to make PostgreSQL listen -# on a non-local interface via the listen_addresses configuration parameter, -# or via the -i or -h command line switches. -# - - - - -# DO NOT DISABLE! -# If you change this first entry you will need to make sure that the -# database -# super user can access the database using some other method. -# Noninteractive -# access to all databases is required during automatic maintenance -# (custom daily cronjobs, replication, and similar tasks). -# -# Database administrative login by UNIX sockets -local all postgres trust - -# TYPE DATABASE USER CIDR-ADDRESS METHOD - -# "local" is for Unix domain socket connections only -#local all all trust -# IPv4 local connections: -#host all all 127.0.0.1/32 md5 -# IPv6 local connections: -#host all all ::1/128 md5 -# This is for general access databases: -local all all trust -host all all 127.0.0.1/32 trust diff --git a/examples/wagtaildemo/requirements.txt b/examples/wagtaildemo/requirements.txt new file mode 100644 index 00000000..a15cc1f0 --- /dev/null +++ b/examples/wagtaildemo/requirements.txt @@ -0,0 +1,19 @@ +Django>=1.10,<1.11 +psycopg2==2.6 +django-compressor>=1.4 +django-modelcluster>=0.6 +wagtail>=1.10,<1.11 +django-taggit>=0.14.0 +django-libsass>=0.2 +libsass==0.8.2 +Pillow==3.2.0 +html5lib==0.999999 + +# Dependencies for hosting +django-redis==3.8.2 +elasticsearch==1.2.0 + +# Dependencies for Heroku deployment +dj-database-url==0.3.0 +whitenoise>=3.1,<4.0 +uwsgi>=2.0,<2.1 diff --git a/examples/wagtaildemo/requirements/base.txt b/examples/wagtaildemo/requirements/base.txt deleted file mode 100644 index 118530bf..00000000 --- a/examples/wagtaildemo/requirements/base.txt +++ /dev/null @@ -1,8 +0,0 @@ -Django>=1.6.2,<1.7 -South>=1.0.0 -psycopg2>=2.5.2 -django-compressor>=1.4 -django-modelcluster>=0.4 -wagtail>=0.7 -django-taggit>=0.11.2 -django-libsass>=0.2 diff --git a/examples/wagtaildemo/requirements/dev.txt b/examples/wagtaildemo/requirements/dev.txt deleted file mode 100644 index a3e81b8d..00000000 --- a/examples/wagtaildemo/requirements/dev.txt +++ /dev/null @@ -1 +0,0 @@ --r base.txt diff --git a/examples/wagtaildemo/requirements/production.txt b/examples/wagtaildemo/requirements/production.txt deleted file mode 100644 index bd00e816..00000000 --- a/examples/wagtaildemo/requirements/production.txt +++ /dev/null @@ -1,6 +0,0 @@ --r base.txt -django-celery==3.1.1 -gunicorn==18.0 -redis==2.9.1 -django-redis-cache==0.10.2 -elasticsearch==1.0.0 diff --git a/examples/wagtaildemo/vagrant/provision.sh b/examples/wagtaildemo/vagrant/provision.sh new file mode 100755 index 00000000..eee2653a --- /dev/null +++ b/examples/wagtaildemo/vagrant/provision.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +PROJECT_NAME="wagtaildemo" + +PROJECT_DIR=/home/vagrant/wagtaildemo +VIRTUALENV_DIR=/home/vagrant/.virtualenvs/$PROJECT_NAME + +PYTHON=$VIRTUALENV_DIR/bin/python +PIP=$VIRTUALENV_DIR/bin/pip + + +# Create database +su - vagrant -c "createdb $PROJECT_NAME" + + +# Virtualenv setup for project +su - vagrant -c "pyvenv $VIRTUALENV_DIR" +# Replace previous line with this if you are using Python 2 +# su - vagrant -c "/usr/local/bin/virtualenv $VIRTUALENV_DIR" + +su - vagrant -c "echo $PROJECT_DIR > $VIRTUALENV_DIR/.project" + +#Update pip +su - vagrant -c "$PIP install -U pip" + +# Install PIP requirements +su - vagrant -c "$PIP install -r $PROJECT_DIR/requirements.txt -f /home/vagrant/wheelhouse" + + +# Set execute permissions on manage.py as they get lost if we build from a zip file +chmod a+x $PROJECT_DIR/manage.py + + +# Run migrate/update_index/load_initial_data +su - vagrant -c "$PYTHON $PROJECT_DIR/manage.py migrate --noinput && \ + $PYTHON $PROJECT_DIR/manage.py load_initial_data && \ + $PYTHON $PROJECT_DIR/manage.py update_index" + + +# Add a couple of aliases to manage.py into .bashrc +cat << EOF >> /home/vagrant/.bashrc +export PYTHONPATH=$PROJECT_DIR +export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev + +alias dj="django-admin" +alias djrun="dj runserver 0.0.0.0:8000" + +source $VIRTUALENV_DIR/bin/activate +export PS1="[$PROJECT_NAME \W]\\$ " +cd $PROJECT_DIR +EOF diff --git a/examples/wagtaildemo/wagtaildemo/heroku_wsgi.py b/examples/wagtaildemo/wagtaildemo/heroku_wsgi.py new file mode 100644 index 00000000..743f5e43 --- /dev/null +++ b/examples/wagtaildemo/wagtaildemo/heroku_wsgi.py @@ -0,0 +1,6 @@ +from whitenoise.django import DjangoWhiteNoise + +from .wsgi import application as _application + + +application = DjangoWhiteNoise(_application) diff --git a/examples/wagtaildemo/wagtaildemo/settings/base.py b/examples/wagtaildemo/wagtaildemo/settings/base.py index e4227310..187b169a 100644 --- a/examples/wagtaildemo/wagtaildemo/settings/base.py +++ b/examples/wagtaildemo/wagtaildemo/settings/base.py @@ -3,16 +3,14 @@ import os PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..', '..') +BASE_DIR = PROJECT_ROOT DEBUG = True -TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) -MANAGERS = ADMINS - # Default to dummy email backend. Configure dev/production/local backend # as per https://docs.djangoproject.com/en/dev/topics/email/#email-backends EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' @@ -21,11 +19,6 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'wagtaildemo', - 'USER': 'postgres', - 'PASSWORD': '', - 'HOST': '', # Set to empty string for localhost. - 'PORT': '', # Set to empty string for default. - 'CONN_MAX_AGE': 600, # number of seconds database connections should persist for } } @@ -54,14 +47,13 @@ USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale. -# Note that with this set to True, Wagtail will fall back on using numeric dates -# in date fields, as opposed to 'friendly' dates like "24 Sep 2013", because -# Python's strptime doesn't support localised month names: https://code.djangoproject.com/ticket/13339 -USE_L10N = False +USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True +DATE_FORMAT = 'j F Y' + # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') @@ -103,13 +95,6 @@ STATICFILES_FINDERS = ( # Make this unique, and don't share it with anybody. SECRET_KEY = 'wq21wtjo3@d_qfjvd-#td!%7gfy2updj2z+nev^k$iy%=m4_tr' -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - # 'django.template.loaders.eggs.Loader', -) - MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -123,25 +108,11 @@ MIDDLEWARE_CLASSES = ( 'wagtail.wagtailredirects.middleware.RedirectMiddleware', ) -from django.conf import global_settings -TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( - 'django.core.context_processors.request', - "fobi.context_processors.theme", # Important! - "fobi.context_processors.dynamic_values", # Optional - "context_processors.testing", # Testing -) - ROOT_URLCONF = 'wagtaildemo.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'wagtaildemo.wsgi.application' -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. -) - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', @@ -150,10 +121,10 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', - 'south', 'compressor', 'taggit', 'modelcluster', + 'rest_framework', 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', @@ -169,6 +140,7 @@ INSTALLED_APPS = ( 'wagtail.wagtailredirects', 'wagtail.wagtailforms', 'wagtail.wagtailsites', + 'wagtail.contrib.wagtailapi', 'demo', @@ -294,19 +266,45 @@ INSTALLED_APPS = ( 'fobi.contrib.themes.simple', # Simple theme ) +# Add wagtail.contrib.wagtailsearchpromotions to INSTALLED_APPS +# if we're on Wagtail 1.1 or later. +# NB this is a quick-and-dirty version check that won't work with +# full generality (double-digit versions, alpha/beta releases) +from wagtail.wagtailcore import __version__ +if __version__.split('.') > ['1', '0']: + INSTALLED_APPS = list(INSTALLED_APPS) + ['wagtail.contrib.wagtailsearchpromotions'] + + EMAIL_SUBJECT_PREFIX = '[wagtaildemo] ' INTERNAL_IPS = ('127.0.0.1', '10.0.2.2') + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.contrib.auth.context_processors.auth', + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.contrib.messages.context_processors.messages', + "fobi.context_processors.theme", # Important! + "fobi.context_processors.dynamic_values", # Optional + "context_processors.testing", # Testing + ], + }, + }, +] + # django-compressor settings COMPRESS_PRECOMPILERS = ( ('text/x-scss', 'django_libsass.SassCompiler'), ) -# Auth settings -LOGIN_URL = 'django.contrib.auth.views.login' -LOGIN_REDIRECT_URL = 'wagtailadmin_home' - # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False. @@ -340,6 +338,3 @@ LOGGING = { # WAGTAIL SETTINGS WAGTAIL_SITE_NAME = 'wagtaildemo' - -# Override the search results template for wagtailsearch -WAGTAILSEARCH_RESULTS_TEMPLATE = 'demo/search_results.html' diff --git a/examples/wagtaildemo/wagtaildemo/settings/dev.py b/examples/wagtaildemo/wagtaildemo/settings/dev.py index c55e11f2..a7cea7de 100644 --- a/examples/wagtaildemo/wagtaildemo/settings/dev.py +++ b/examples/wagtaildemo/wagtaildemo/settings/dev.py @@ -5,7 +5,7 @@ DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # BASE_URL required for notification emails -BASE_URL = 'http://localhost:8111' +BASE_URL = 'http://localhost:8000' try: from .local import * diff --git a/examples/wagtaildemo/wagtaildemo/settings/heroku.py b/examples/wagtaildemo/wagtaildemo/settings/heroku.py new file mode 100644 index 00000000..17de7f28 --- /dev/null +++ b/examples/wagtaildemo/wagtaildemo/settings/heroku.py @@ -0,0 +1,25 @@ +import dj_database_url +import os + +from .base import * + + +DEBUG = True + +# Accept all hostnames, since we don't know in advance which hostname will be used for any given Heroku instance. +# IMPORTANT: Set this to a real hostname when using this in production! +# See https://docs.djangoproject.com/en/1.10/ref/settings/#allowed-hosts +ALLOWED_HOSTS = ['*'] + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + +# BASE_URL required for notification emails +BASE_URL = 'http://localhost:8000' + +DATABASES = {'default': dj_database_url.config(default='postgres://postgres@localhost:5432/wagtaildemo')} + + +try: + from .local import * +except ImportError: + pass diff --git a/examples/wagtaildemo/wagtaildemo/settings/local.py.example b/examples/wagtaildemo/wagtaildemo/settings/local.py.example index 729293c4..8d486c10 100644 --- a/examples/wagtaildemo/wagtaildemo/settings/local.py.example +++ b/examples/wagtaildemo/wagtaildemo/settings/local.py.example @@ -3,7 +3,7 @@ # local.py should not be checked in to version control. EMBEDLY_KEY = 'get-one-from-http://embed.ly/' -GOOGLE_MAPS_KEY = 'get-one-from-https://code.google.com/apis/console/?noredirect' +# GOOGLE_MAPS_KEY = 'get-one-from-https://code.google.com/apis/console/?noredirect' # It is strongly recommended that you define a SECRET_KEY here, where it won't be visible # in your version control system. @@ -12,29 +12,17 @@ SECRET_KEY = 'enter-a-long-unguessable-string-here' # When developing Wagtail templates, we recommend django-debug-toolbar # for keeping track of page rendering times. To use it: -# pip install django-debug-toolbar==1.0.1 -# and uncomment the lines below. +# pip install django-debug-toolbar +# uncomment the lines below, and uncomment the corresponding lines in urls.py # from .base import INSTALLED_APPS, MIDDLEWARE_CLASSES # INSTALLED_APPS += ( # 'debug_toolbar', # ) -# MIDDLEWARE_CLASSES += ( +# MIDDLEWARE_CLASSES = [ # 'debug_toolbar.middleware.DebugToolbarMiddleware', -# ) +# ] + list(MIDDLEWARE_CLASSES) # # django-debug-toolbar settings # DEBUG_TOOLBAR_CONFIG = { # 'INTERCEPT_REDIRECTS': False, # } - - -# If you're developing Wagtail itself (as opposed to building a Wagtail-powered site), you'll -# want to tweak the Python path so that it picks up your working copy of the Wagtail code -# rather than the packaged copy - uncomment the lines below to do that. -# Here we assume that you have it in a 'wagtail' directory at the same level as your -# 'wagtaildemo' checkout - adjust the path as appropriate. - -# import sys -# import os -# PATH_TO_WAGTAIL = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'wagtail') -# sys.path.insert(1, PATH_TO_WAGTAIL) diff --git a/examples/wagtaildemo/wagtaildemo/settings/production.py b/examples/wagtaildemo/wagtaildemo/settings/production.py index 601a7f96..aa5fdcfa 100644 --- a/examples/wagtaildemo/wagtaildemo/settings/production.py +++ b/examples/wagtaildemo/wagtaildemo/settings/production.py @@ -11,13 +11,6 @@ WAGTAILSEARCH_BACKENDS = { } -INSTALLED_APPS+= ( - 'djcelery', - 'kombu.transport.django', - 'gunicorn', -) - - CACHES = { 'default': { 'BACKEND': 'redis_cache.cache.RedisCache', @@ -37,14 +30,6 @@ TEMPLATE_LOADERS = ( )), ) -# CELERY SETTINGS -import djcelery -djcelery.setup_loader() - -BROKER_URL = 'redis://' -CELERY_SEND_TASK_ERROR_EMAILS = True -CELERYD_LOG_COLOR = False - try: from .local import * diff --git a/examples/wagtaildemo/wagtaildemo/urls.py b/examples/wagtaildemo/wagtaildemo/urls.py index 07dca2e3..af689b79 100644 --- a/examples/wagtaildemo/wagtaildemo/urls.py +++ b/examples/wagtaildemo/wagtaildemo/urls.py @@ -1,41 +1,59 @@ -from django.conf.urls import patterns, include, url +from django.conf.urls import include, url from django.conf.urls.static import static -from django.views.generic.base import RedirectView -from django.contrib import admin from django.conf import settings -import os.path +from django.contrib import admin -from wagtail.wagtailcore import urls as wagtail_urls from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls -from wagtail.wagtailsearch.urls import frontend as wagtailsearch_frontend_urls +from wagtail.wagtailcore import urls as wagtail_urls +from wagtail.contrib.wagtailapi import urls as wagtailapi_urls +from wagtail.api.v2.router import WagtailAPIRouter +from wagtail.api.v2.endpoints import PagesAPIEndpoint +from wagtail.wagtaildocs.api.v2.endpoints import DocumentsAPIEndpoint +from wagtail.wagtailimages.api.v2.endpoints import ImagesAPIEndpoint -admin.autodiscover() +from demo import views -# Signal handlers -from wagtail.wagtailsearch.signal_handlers import register_signal_handlers as wagtailsearch_register_signal_handlers -wagtailsearch_register_signal_handlers() +api = WagtailAPIRouter('api') +api.register_endpoint('pages', PagesAPIEndpoint) +api.register_endpoint('images', ImagesAPIEndpoint) +api.register_endpoint('documents', DocumentsAPIEndpoint) -urlpatterns = patterns('', +urlpatterns = [ url(r'^django-admin/', include(admin.site.urls)), url(r'^admin/', include(wagtailadmin_urls)), - url(r'^search/', include(wagtailsearch_frontend_urls)), url(r'^documents/', include(wagtaildocs_urls)), - # For anything not caught by a more specific rule above, hand over to - # Wagtail's serving mechanism - url(r'', include(wagtail_urls)), -) + url(r'search/$', views.search, name='search'), + url(r'^api/', include(wagtailapi_urls)), + url(r'^api/v2/', include(api.urls)), +] if settings.DEBUG: from django.contrib.staticfiles.urls import staticfiles_urlpatterns + from django.views.generic.base import RedirectView - urlpatterns += staticfiles_urlpatterns() # tell gunicorn where static files are in dev mode - urlpatterns += static(settings.MEDIA_URL + 'images/', document_root=os.path.join(settings.MEDIA_ROOT, 'images')) - urlpatterns += patterns('', - (r'^favicon\.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'demo/images/favicon.ico')) - ) + urlpatterns += staticfiles_urlpatterns() + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns += [ + url(r'^favicon\.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'demo/images/favicon.ico')) + ] + + # Uncomment the lines below to enable django-debug-toolbar (along with the + # corresponding lines in settings/local.py): + #import debug_toolbar + + #urlpatterns += [ + # url(r'^__debug__/', include(debug_toolbar.urls)), + #] + + +# For anything not caught by a more specific rule above, hand over to +# Wagtail's serving mechanism (must come last) +urlpatterns += [ + url(r'', include(wagtail_urls)), +]