Skip to content
This repository
Browse code

Merge pull request #91 from evildmp/fix-roles

Fix roles
  • Loading branch information...
commit ca8e2792f8315a92be720f1f951b91b77f0f9e0d 2 parents 7178508 + 293391a
Daniele Procida authored April 26, 2013

Showing 75 changed files with 3 additions and 7,957 deletions. Show diff stats Hide diff stats

  1. 3  .gitignore
  2. 2  contacts_and_people/models.py
  3. BIN  docs/_build/doctrees/arkestra_for_users/entities.doctree
  4. BIN  docs/_build/doctrees/arkestra_for_users/introduction.doctree
  5. BIN  docs/_build/doctrees/arkestra_for_users/things_never_to_do.doctree
  6. BIN  docs/_build/doctrees/environment.pickle
  7. BIN  docs/_build/doctrees/getting_started/getting_started.doctree
  8. BIN  docs/_build/doctrees/getting_started/installation.doctree
  9. BIN  docs/_build/doctrees/getting_started/installation_notes.doctree
  10. BIN  docs/_build/doctrees/getting_started/starting_your_own_project.doctree
  11. BIN  docs/_build/doctrees/how_it_works/arkestra_generic_models.doctree
  12. BIN  docs/_build/doctrees/how_it_works/image_sizing_system.doctree
  13. BIN  docs/_build/doctrees/how_it_works/links_system.doctree
  14. BIN  docs/_build/doctrees/how_it_works/migration.doctree
  15. BIN  docs/_build/doctrees/how_it_works/templates.doctree
  16. BIN  docs/_build/doctrees/how_it_works/using_news_and_events.doctree
  17. BIN  docs/_build/doctrees/how_it_works/video_system.doctree
  18. BIN  docs/_build/doctrees/index.doctree
  19. 4  docs/_build/html/.buildinfo
  20. BIN  docs/_build/html/_images/entity-change-list.png
  21. BIN  docs/_build/html/_images/entity-change-view.png
  22. 144  docs/_build/html/_sources/arkestra_for_users/entities.txt
  23. 76  docs/_build/html/_sources/arkestra_for_users/introduction.txt
  24. 47  docs/_build/html/_sources/arkestra_for_users/things_never_to_do.txt
  25. 45  docs/_build/html/_sources/getting_started/getting_started.txt
  26. 71  docs/_build/html/_sources/getting_started/installation.txt
  27. 82  docs/_build/html/_sources/getting_started/installation_notes.txt
  28. 45  docs/_build/html/_sources/getting_started/starting_your_own_project.txt
  29. 452  docs/_build/html/_sources/how_it_works/arkestra_generic_models.txt
  30. 183  docs/_build/html/_sources/how_it_works/image_sizing_system.txt
  31. 141  docs/_build/html/_sources/how_it_works/links_system.txt
  32. 160  docs/_build/html/_sources/how_it_works/migration.txt
  33. 55  docs/_build/html/_sources/how_it_works/templates.txt
  34. 83  docs/_build/html/_sources/how_it_works/using_news_and_events.txt
  35. 16  docs/_build/html/_sources/how_it_works/video_system.txt
  36. 65  docs/_build/html/_sources/index.txt
  37. BIN  docs/_build/html/_static/ajax-loader.gif
  38. 540  docs/_build/html/_static/basic.css
  39. BIN  docs/_build/html/_static/comment-bright.png
  40. BIN  docs/_build/html/_static/comment-close.png
  41. BIN  docs/_build/html/_static/comment.png
  42. 256  docs/_build/html/_static/default.css
  43. 247  docs/_build/html/_static/doctools.js
  44. BIN  docs/_build/html/_static/down-pressed.png
  45. BIN  docs/_build/html/_static/down.png
  46. BIN  docs/_build/html/_static/file.png
  47. 154  docs/_build/html/_static/jquery.js
  48. BIN  docs/_build/html/_static/minus.png
  49. BIN  docs/_build/html/_static/plus.png
  50. 62  docs/_build/html/_static/pygments.css
  51. 560  docs/_build/html/_static/searchtools.js
  52. 151  docs/_build/html/_static/sidebar.js
  53. 23  docs/_build/html/_static/underscore.js
  54. BIN  docs/_build/html/_static/up-pressed.png
  55. BIN  docs/_build/html/_static/up.png
  56. 808  docs/_build/html/_static/websupport.js
  57. 260  docs/_build/html/arkestra_for_users/entities.html
  58. 179  docs/_build/html/arkestra_for_users/introduction.html
  59. 163  docs/_build/html/arkestra_for_users/things_never_to_do.html
  60. 96  docs/_build/html/genindex.html
  61. 129  docs/_build/html/getting_started/getting_started.html
  62. 178  docs/_build/html/getting_started/installation.html
  63. 198  docs/_build/html/getting_started/installation_notes.html
  64. 151  docs/_build/html/getting_started/starting_your_own_project.html
  65. 499  docs/_build/html/how_it_works/arkestra_generic_models.html
  66. 301  docs/_build/html/how_it_works/image_sizing_system.html
  67. 250  docs/_build/html/how_it_works/links_system.html
  68. 280  docs/_build/html/how_it_works/migration.html
  69. 161  docs/_build/html/how_it_works/templates.html
  70. 238  docs/_build/html/how_it_works/using_news_and_events.html
  71. 132  docs/_build/html/how_it_works/video_system.html
  72. 169  docs/_build/html/index.html
  73. BIN  docs/_build/html/objects.inv
  74. 100  docs/_build/html/search.html
  75. 1  docs/_build/html/searchindex.js
3  .gitignore
@@ -37,4 +37,5 @@ _design
37 37
 _content
38 38
 _tmp
39 39
 dist
40  
-build
  40
+build
  41
+_build
2  contacts_and_people/models.py
@@ -492,7 +492,7 @@ def get_roles_for_members(self, members):
492 492
         The roles returned are in alphabetical order by Person.
493 493
         """
494 494
         for member in members:
495  
-            ms = member.member_of()
  495
+            ms = member.member_of
496 496
             # get the best named membership in the entity
497 497
             named_memberships = list(ms.filter(entity=self).exclude(role ="").order_by('-importance_to_person'))
498 498
             if named_memberships:
BIN  docs/_build/doctrees/arkestra_for_users/entities.doctree
Binary file not shown
BIN  docs/_build/doctrees/arkestra_for_users/introduction.doctree
Binary file not shown
BIN  docs/_build/doctrees/arkestra_for_users/things_never_to_do.doctree
Binary file not shown
BIN  docs/_build/doctrees/environment.pickle
Binary file not shown
BIN  docs/_build/doctrees/getting_started/getting_started.doctree
Binary file not shown
BIN  docs/_build/doctrees/getting_started/installation.doctree
Binary file not shown
BIN  docs/_build/doctrees/getting_started/installation_notes.doctree
Binary file not shown
BIN  docs/_build/doctrees/getting_started/starting_your_own_project.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/arkestra_generic_models.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/image_sizing_system.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/links_system.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/migration.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/templates.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/using_news_and_events.doctree
Binary file not shown
BIN  docs/_build/doctrees/how_it_works/video_system.doctree
Binary file not shown
BIN  docs/_build/doctrees/index.doctree
Binary file not shown
4  docs/_build/html/.buildinfo
... ...
@@ -1,4 +0,0 @@
1  
-# Sphinx build info version 1
2  
-# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3  
-config: 30564d2d9d9b2ee309d8f7951e50770d
4  
-tags: fbb0d17656682115ca4d033fb2f83ba1
BIN  docs/_build/html/_images/entity-change-list.png
BIN  docs/_build/html/_images/entity-change-view.png
144  docs/_build/html/_sources/arkestra_for_users/entities.txt
... ...
@@ -1,144 +0,0 @@
1  
-####################
2  
-Entities
3  
-####################  
4  
-
5  
-**************************************************
6  
-What exactly is an entity?
7  
-**************************************************
8  
-An *entity* could be:
9  
-
10  
-an organisation:
11  
-	*Cardiff University School of Medicine*
12  
-a part of a larger organisation:
13  
-	*Institute of Infection & Immunity*
14  
-	*Research Office*
15  
-a group of other entities:
16  
-	*Research institutes*

17  
-	*Administrative & support offices*
18  
-a collection of people:
19  
-	*Web editors*
20  
-	*School IT liaison officers*
21  
-	
22  
-Entities exist in a *hierarchy*, which might look like:
23  
-
24  
-*	Cardiff University
25  
-
26  
-	*	Cardiff University School of Medicine
27  
-
28  
-		*	Institutes
29  
-
30  
-			*	Institute of Infection & Immunity	 
31  
-			*	Institute of Cancer Genetics
32  
-			*	Institute of Medical Education
33  
-
34  
-				*	Admissions
35  
-				*	Assessments
36  
-		*	Administrative offices
37  
-
38  
-			*	Finance
39  
-			*	Personnel
40  
-
41  
-**************************************************
42  
-Managing entities
43  
-**************************************************
44  
-
45  
-Let's start by getting to work on an entity.
46  
-
47  
-The Entities change list
48  
-************************
49  
-
50  
-In the Arkestra admin site, find `Contacts & people` > `Entities`. They are arranged in a tree reflecting the hierarchy of entities.
51  
-
52  
-.. figure:: entity-change-list.png 
53  
-   :width: 100%
54  
-   :alt: map to buried treasure
55  
-
56  
-   The **Entities** change list
57  
-
58  
-You can:
59  
-
60  
-* **search** the list of Entities
61  
-* **filter** the list according to various criteria
62  
-* **expand and collapse** sections of the hiearchy using the controls in the window
63  
-* **move** entites by dragging them around within the tree
64  
-
65  
-Either select an existing entity to edit, or create a new one if none exist.    
66  
-
67  
-Editing an entity
68  
-*****************
69  
-
70  
-.. figure:: entity-change-view.png 
71  
-   :width: 100%
72  
-   :alt: map to buried treasure
73  
-
74  
-   The **Entity** change view - you'll find many of the same controls and
75  
-   features throughout Arkestra's adminstration interface.
76  
-
77  
-This is where we tell Arkestra what it needs to know about our entity.
78  
-
79  
-Basic information
80  
-=================
81  
-
82  
-Name   
83  
-	its official title, in full
84  
-
85  
-Short name for menus
86  
-	a shorter version, if required
87  
-
88  
-Image 
89  
-	an image (for example a logo)
90  
-
91  
-Home page
92  
-	The entity will likely have a number of pages associated with it in the
93  
-	**Pages** system that; select the root page of that section. Arkestra will
94  
-	know that *all* the pages in that section belong to this entity.
95  
-
96  
-Parent
97  
-	The entity's parent in the hierarchy. You can also change this by dragging the entity around in the change list, but if the hierarchy contains hundreds of items, this is a more efficient way to do it.
98  
-	
99  
-Include parent entity's name in address
100  
-	Arkestra builds an entity's address automatically, and will include its parent's name in that automatically. Usually that makes sense (*IT Office, School of Medicine*, but sometimes it might look silly (*Cardiff University School of Medicine, Cardiff University*), so this allows us to turn it off.
101  
-	
102  
-Abstract
103  
-	Some entities are actual organisational entities, like the University or the Research Office. Others are just useful groupings, or *abstract entities*.   
104  
-	
105  
-Location
106  
-========
107  
-
108  
-Address
109  
-	This is there to show you how Arkestra will render the entity's address       
110  
-	
111  
-Building
112  
-	where the entity is based
113  
-	
114  
-Building recapitulates entity name
115  
-	Sometimes, the building name and the entity name are so similar it would be silly to have them both in the address. If so, this field allows Arkestra to know that it shouldn't include them both in addresses
116  
-	
117  
-Precise location
118  
-	the place *inside* the building - floor, room number, etc
119  
-	
120  
-Precise location
121  
-	any note for potential visitors 
122  
-	
123  
-Contact
124  
-========     
125  
-
126  
-Email address
127  
-	if the entity has its own email address
128  
-
129  
-Phone contacts
130  
-	choose or add a suitable label; don't try to format numbers
131  
-	
132  
-Contacts & people, News & Events, Vacancies & Studentships
133  
-==========================================================
134  
-
135  
-Arkestra will publish pages of various types automatically if required. The
136  
-controls are very similar for them all, and also for other modules that might
137  
-be added by other applications, and will look much like:
138  
-
139  
-Publish a contacts and people page for this entity automatically 
140  
-   if this entity should have its own contacts and people page
141  
-
142  
-Title
143  
-	what the page should be called
144  
-	
76  docs/_build/html/_sources/arkestra_for_users/introduction.txt
... ...
@@ -1,76 +0,0 @@
1  
-#######################
2  
-The concept of Arkestra
3  
-#######################  
4  
-
5  
-Arkestra was conceived as an answer to the problem: **what is the best way for
6  
-an organisation to publish information on the web?**
7  
-
8  
-**************************************************
9  
-The shortcomings of web content management systems
10  
-**************************************************
11  
-
12  
-**Content management systems rarely work very well**, especially when
13  
-organisations use them, and the bigger the organisation and the site, the
14  
-worse the problems.
15  
-
16  
-Web content management systems waste users' time, and their work, and produce
17  
-sites full of inconsistent content, inconsistently presented.
18  
-
19  
-They don't offer users enough freedom to do what they need, and they offer too
20  
-much, so they can do things they shouldn't - both at the same time.
21  
-
22  
-Arkestra is an attempt to avoid these pitfalls, by taking a different
23  
-approach.
24  
-
25  
-**************************************************
26  
-Arkestra's approach
27  
-**************************************************
28  
-
29  
-Arkestra **models the real world**, building meaningful real-world relationships
30  
-into its structures.
31  
-
32  
-It's a **semantic publishing system** rather than a *content management system*;
33  
-it handles **meaningful information**, rather than mere content or data, and makes
34  
-as much use as possible of this information as possible.
35  
-
36  
-Arkestra has been designed around a single key imperative: **don't waste
37  
-people’s time.**
38  
-
39  
-Wherever possible, Arkestra should:
40  
-
41  
-* make it easy to capture and manage useful information
42  
-* make the information easily re-usable
43  
-* re-use it automatically and appropriately whenever possible 
44  
-
45  
-**************************************************
46  
-Arkestra's model of the world
47  
-**************************************************
48  
-
49  
-Arkestra begins by modelling the basic concept of an organisation. An
50  
-organisation - an **Entity** in Arkestra's terminology - might:
51  
-
52  
-* contain other sub-entities within it 
53  
-* occupy a number of buildings across different sites
54  
-* have people who have various different roles in it, and engage in different
55  
-  activities
56  
-* hold events of various kinds
57  
-* need to publish news about its activities
58  
-
59  
-... amongst numerous other things.
60  
-
61  
-Arkestra models all of these, and their relationships to each other.
62  
-
63  
-If an entity is a based in a certain building, and that building has a postal
64  
-address, Arkestra can work out the correct postal address for the entity. If a
65  
-person works in that entity, Arkestra can infer the person's address.
66  
-
67  
-If a particular set of web pages is associated with a particular entity, then
68  
-Arkestra will be able to associate other relevant things with those pages -
69  
-people, events, news and so on - automatically.
70  
-
71  
-These things can will also be associated with each other in various important
72  
-ways in the real world: an event might feature particular people, and take
73  
-place at a particular date and time, in a particular location; Arkestra models
74  
-and makes use of these relationships too.
75  
-
76  
-The next section will examine entities more closely.
47  docs/_build/html/_sources/arkestra_for_users/things_never_to_do.txt
... ...
@@ -1,47 +0,0 @@
1  
-##########################
2  
-Things you should never do
3  
-##########################  
4  
-
5  
-Arkestra has been deisgned to guide you towards the right way of doing things, and away from bad practices. As far as it can, it will warn or even reprimand you when necessary, but you still need to be aware of the right and wrong way to do things.
6  
-
7  
-**************************************************
8  
-Warning signs
9  
-**************************************************
10  
-
11  
-If you ever find yourself doing any of these things, it's an excellent sign that you are probably doing something wrong:
12  
-
13  
-Entering information that is already in Arkestra
14  
-************************************************ 
15  
-
16  
-The whole point of Arkestra is to record, manage and publish information,
17  
-automatically wherever possible. If you find yourself entering the same
18  
-information twice, then you're not allowing Arkestra to help you by re-using
19  
-it (it also means that you now have the information in two places, both of
20  
-which will have to be kept up-to-date).
21  
-
22  
-A good example is address information. You should almost never have to write
23  
-out an address in Arkestra. Arkestra maintains information about places,
24  
-including their addresses.
25  
-
26  
-Inventing new ways of using it
27  
-******************************
28  
-
29  
-Don't be creative with Arkestra. There's no guarantee that the clever new way
30  
-of doing something you've discovered will continue to work in the future. It's
31  
-much safer and more reliable to learn how Arkestra is *supposed* to work.
32  
-
33  
-Finding 'solutions' to apparent problems or shortcomings
34  
-********************************************************
35  
-
36  
-You're almost certain to discover shortcomings and even faults in Arkestra.
37  
-Don't try to work around them. That will only ever produce a second-best, and
38  
-uncertain, solution. It's much better to report them, so that Arkestra can be
39  
-improved, and accommodate whatever need you have for it.
40  
-
41  
-**************************************************
42  
-The worst things you can do
43  
-**************************************************
44  
-
45  
-Some abuses are worse than others...
46  
-
47  
-1.  Write "here", or "click here", in link text.
45  docs/_build/html/_sources/getting_started/getting_started.txt
... ...
@@ -1,45 +0,0 @@
1  
-#########################
2  
-Starting your own project
3  
-#########################
4  
-
5  
-*********************************
6  
-Using the bundled example project
7  
-*********************************
8  
-
9  
-Arkestra comes with a bundled example project - in the `example` folder - which is ready to go, complete with database and media files.
10  
-
11  
-Once you have the example project running, have a look at the site.
12  
-
13  
-The admin interface is at `/admin`; username and password are both `arkestra`.
14  
-
15  
-Once logged in to the admin, set your `Site` appropriately - `/admin/sites/site/`.
16  
-
17  
-************************
18  
-Running your own project
19  
-************************
20  
-
21  
-The `example` project in Arkestra contains a ready-made `settings.py` file, not to mention the `urls.py` and so on that you'll need.
22  
-
23  
-Either copy these, or if you know what you're doing, copy the relevant parts to the files in your own project.
24  
-
25  
-Start with the Python runserver, and get that going.
26  
-
27  
-In order to make anything work, you'll need to do log in to Admin (username and password are both `arkestra`) and do three things.
28  
-
29  
-* create a Page
30  
-* create an Entity
31  
-* link the Entity to the Page, by selecting the Page as the Entity's /Home page/
32  
-
33  
-And since Arkestra needs to know what the *base entity* of your site is, in your ``arkestra_settings`` file add something like::
34  
-
35  
-ARKESTRA_BASE_ENTITY = 1
36  
-
37  
-where the value corresponds to the id of your base entity.
38  
-
39  
-*************
40  
-In production
41  
-*************
42  
-
43  
-Run `collectstatic` - https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles for media files to get them into the right place.
44  
-
45  
-For deployment, point your web hosting platform not at `settings.py`, but `deployment_settings.py`, which turns off various debug modes. 
71  docs/_build/html/_sources/getting_started/installation.txt
... ...
@@ -1,71 +0,0 @@
1  
-############
2  
-Installation
3  
-############
4  
-
5  
-
6  
-***********
7  
-Quick start
8  
-***********
9  
-
10  
-Prerequisites
11  
-=============
12  
-
13  
-These steps assume that you have the following available on your system:
14  
-
15  
-* pip
16  
-* Git
17  
-* Mercurial
18  
-
19  
-Set up a virtual environment 
20  
-============================
21  
-
22  
-::
23  
-
24  
-    virtualenv arkestra
25  
-    cd arkestra/
26  
-    source bin/activate
27  
-
28  
-Install PIP components
29  
-======================
30  
-
31  
-::
32  
-
33  
-    # install Arkestra & dependencies 
34  
-    pip install -e git+https://github.com/evildmp/Arkestra.git@develop#egg=Arkestra 
35  
-    # install the things that pip can't do automatically                        
36  
-    pip install -r src/arkestra/REQUIREMENTS.txt
37  
-
38  
-
39  
-From this point you can wrestle Arkestra into submission on your own, or get started using the `example` project included.
40  
-
41  
-Set up the supplied example project
42  
-===================================
43  
-
44  
-Arkestra includes an example project for Django 1.4.
45  
-
46  
-Assuming that your code was installed into src/arkestra in your virtualenv::
47  
-                                   
48  
-    cd src/arkestra/example
49  
-    python manage.py syncdb --noinput # set up a new database; don't prompt for superuser
50  
-    python manage.py loaddata example_database.json # load the example database from the fixture
51  
-
52  
-Fire up the server
53  
-==================                     
54  
-
55  
-::
56  
-
57  
-    python manage.py runserver 0.0.0.0:8000 # go!
58  
-
59  
-You should see the famous Institute of Mediaeval Medicine website, complete with images and all kinds of interesting content.
60  
-
61  
-Username and password are both `arkestra`. 
62  
-    
63  
-
64  
-Note!
65  
-=====
66  
-
67  
-When you start up the server, you won't see any of the news/events/vacancies/studentships items you'd expect. 
68  
-
69  
-That's because they're all out of date by now - this database was created some time ago.
70  
-
71  
-Go into the news/events/vacancies/studentships and give them more appropriate dates.
82  docs/_build/html/_sources/getting_started/installation_notes.txt
... ...
@@ -1,82 +0,0 @@
1  
-#############################
2  
-More notes about installation
3  
-#############################
4  
-
5  
-With luck you won't even need to refer to this, but just in case, here it is.
6  
-
7  
-The Arkestra applications
8  
-=========================
9  
-
10  
-Arkestra is a collection of applications, each of which needs to be put on your PYTHONPATH (Arkestra's setup.py should do this for you):
11  
-
12  
-* arkestra_image_plugin
13  
-* arkestra_utilities
14  
-* contacts_and_people
15  
-* housekeeping
16  
-* links
17  
-* news_and_events
18  
-* vacancies_and_studentships
19  
-* video
20  
-
21  
-Other components
22  
-================
23  
-
24  
-Akestra requires installation of various components (Arkestra's setup.py should do this for you). They include:
25  
-
26  
-* `Django CMS <http://django-cms.org/>`_
27  
-* Django Filer
28  
-* Django Widgetry
29  
-* Semantic Presentation Editor
30  
-* django-polymorphic
31  
-* BeautifulSoup
32  
-* django-typogrify
33  
-* pyquery
34  
-* easy-thumbnails
35  
-* django-appmedia
36  
-* PIL
37  
-
38  
-pip freeze
39  
-==========
40  
-
41  
-This is what `pip freeze` reports, just for your information:
42  
-
43  
-* -e git+git@github.com:evildmp/Arkestra.git@a4cba94661af4b22025a301e70c1c5438bbecd65#egg=Arkestra-dev
44  
-* BeautifulSoup==3.2.1
45  
-* Django==1.4
46  
-* Pillow==1.7.7
47  
-* South==0.7.5
48  
-* cssselect==0.7.1
49  
-* django-classy-tags==0.3.4.1
50  
-* -e git+git@github.com:divio/django-cms.git@56afb01890396fe0562c3ce6700afbff81487f80#egg=django_cms-dev
51  
-* -e git+https://github.com/stefanfoulis/django-filer.git@52aa62b11b7c890e45ed0eb45ef37d0300d5d3ee#egg=django_filer-dev
52  
-* django-mptt==0.5.2
53  
-* django-polymorphic==0.2
54  
-* django-sekizai==0.6.1
55  
-* django-typogrify==1.3
56  
-* -e git+git@github.com:evildmp/django-widgetry.git@87885698bb3b1c0913a642a0b242a21557b3da09#egg=django_widgetry-dev
57  
-* easy-thumbnails==1.0.3
58  
-* html5lib==0.95
59  
-* lxml==2.3.4
60  
-* pyquery==1.2.1
61  
-* -e hg+https://bitbucket.org/spookylukey/semanticeditor@6a344716ddd2791c98af773fdfc6bb50107c3b8f#egg=semanticeditor-dev
62  
-* smartypants==1.6.0.3
63  
-* wsgiref==0.1.2
64  
-
65  
-
66  
-Pillow and PIL
67  
-==============
68  
-
69  
-Arkestra will install Pillow. It'll work with PIL too, but Pillow is much easier to use with setuptools.
70  
-
71  
-If you must use PIL
72  
--------------------
73  
-
74  
-You can try `pip install PIL`, but it doesn't always seem to work very well. 
75  
-
76  
-This is often because pip installs PIL from source, and if you don't have the development packages 
77  
-(C headers) then it won't
78  
-compile it with support for all required file formats. Make sure you get the `-dev` packages first. On
79  
-a Debian system doing `apt-get install libjpg-dev libpng-dev` before getting PIL via pip fixed a big 
80  
-problem with image uploads because thumbnails weren't being generated.
81  
- 
82  
-
45  docs/_build/html/_sources/getting_started/starting_your_own_project.txt
... ...
@@ -1,45 +0,0 @@
1  
-#########################
2  
-Starting your own project
3  
-#########################
4  
-
5  
-*********************************
6  
-Using the bundled example project
7  
-*********************************
8  
-
9  
-Arkestra comes with a bundled example project - in the `example` folder - which is ready to go, complete with database and media files.
10  
-
11  
-Once you have the example project running, have a look at the site.
12  
-
13  
-The admin interface is at `/admin`; username and password are both `arkestra`.
14  
-
15  
-Once logged in to the admin, set your `Site` appropriately - `/admin/sites/site/`.
16  
-
17  
-************************
18  
-Running your own project
19  
-************************
20  
-
21  
-The `example` project in Arkestra contains a ready-made `settings.py` file, not to mention the `urls.py` and so on that you'll need.
22  
-
23  
-Either copy these, or if you know what you're doing, copy the relevant parts to the files in your own project.
24  
-
25  
-Start with the Python runserver, and get that going.
26  
-
27  
-In order to make anything work, you'll need to do log in to Admin (username and password are both `arkestra`) and do three things.
28  
-
29  
-* create a Page
30  
-* create an Entity
31  
-* link the Entity to the Page, by selecting the Page as the Entity's /Home page/
32  
-
33  
-And since Arkestra needs to know what the *base entity* of your site is, in your ``arkestra_settings`` file add something like::
34  
-
35  
-    ARKESTRA_BASE_ENTITY = 1
36  
-
37  
-where the value corresponds to the id of your base entity.
38  
-
39  
-*************
40  
-In production
41  
-*************
42  
-
43  
-Run `collectstatic` - https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles for media files to get them into the right place.
44  
-
45  
-For deployment, point your web hosting platform not at `settings.py`, but `deployment_settings.py`, which turns off various debug modes. 
452  docs/_build/html/_sources/how_it_works/arkestra_generic_models.txt
... ...
@@ -1,452 +0,0 @@
1  
-#######################
2  
-Arkestra generic models
3  
-#######################
4  
-
5  
-Arkestra provides a flexible way to query your database for information and have it published - automatically, in the right time, in the right place.
6  
-
7  
-This is a full description of how the news_and_events application does this.
8  
-
9  
-*********
10  
-models.py
11  
-*********
12  
-
13  
-Import the classes you'll need::
14  
-
15  
-	from arkestra_utilities.generic_models import ArkestraGenericPluginOptions, ArkestraGenericModel
16  
-	from arkestra_utilities.mixins import URLModelMixin
17  
-
18  
-Inherit the ones you need into your new model class::
19  
-
20  
-	class NewsArticle(ArkestraGenericModel, URLModelMixin):
21  
-
22  
-You don't need to inherit URLModelMixin, but it can be useful. URLModelMixin provides fields:
23  
-
24  
-* slug
25  
-* external_url
26  
-                                                                                            
27  
-and methods:
28  
-
29  
-* __unicode__() 
30  
-* get_absolute_url() 
31  
-
32  
-URLModelMixin is handy if your instances of your model will each have their own page on the site. 
33  
-
34  
-ArkestraGenericModel provides:
35  
-
36  
-``title``
37  
-    the full title of the item
38  
-
39  
-``short_title``
40  
-    a short version, for lists
41  
-
42  
-``summary``
43  
-    a brief summary, used in lists and on the item's main page
44  
-
45  
-``body``
46  
-    a PlaceholderField    
47  
-
48  
-``image``
49  
-    for the item's page, and to offer a little thumbnail image for lists
50  
-
51  
-``hosted_by``
52  
-    the Entity that hosts or publishes the item
53  
-
54  
-``publish_to``
55  
-    the other Entities to whose pages it should be published
56  
-
57  
-``please_contact``
58  
-    a Person
59  
-
60  
-``importance``
61  
-    so Arkestra can highlight it when appropriate
62  
-
63  
-and @properties:
64  
-
65  
-
66  
-``get_importance``
67  
-    marks items as important, to help gather them together or highlight them in lists as required
68  
-
69  
-``is_uninformative``
70  
-    the item bears little information of its own
71  
-
72  
-``get_template``
73  
-    the template of the webpage of the entity of this item
74  
-
75  
-* ``links``
76  
-* ``external_url``
77  
-* ``get_hosted_by``
78  
-* ``get_website``
79  
-    
80  
-And you can add whatever fields of your own that are required and ignore the ones that are not.
81  
-    
82  
-          
83  
-********                                                            
84  
-admin.py
85  
-********
86  
-
87  
-Import some handy mixins::
88  
-
89  
-	from arkestra_utilities.admin_mixins import SupplyRequestMixin, AutocompleteMixin, InputURLMixin, fieldsets
90  
-      
91  
-* SupplyRequestMixin supplies the context to the admin - you might have a need for it
92  
-* AutocompleteMixin
93  
-* InputURLMixin
94  
-* fieldsets: some handy predefined fieldsets
95  
-
96  
-Define the admin form and class, and do the usual things with them::
97  
-
98  
-	class NewsArticleForm(InputURLMixin):
99  
-	    class Meta:
100  
-	        model = NewsArticle
101  
-
102  
-
103  
-	class NewsArticledmin(SupplyRequestMixin, AutocompleteMixin, ModelAdminWithTabsAndCMSPlaceholder):
104  
-	    related_search_fields = ['hosted_by', 'external_url',] # autocomplete on these fields
105  
-
106  
-	    def _media(self):
107  
-	        return super(AutocompleteMixin, self).media + super(ModelAdminWithTabsAndCMSPlaceholder, self).media
108  
-	    media = property(_media)
109  
-
110  
-
111  
-*******
112  
-urls.py
113  
-*******
114  
-
115  
-To ``urls.py`` add a url pattern::
116  
-
117  
-    (r"^news/(?P<slug>[-\w]+)/$", "news_and_events.views.newsarticle"),
118  
-
119  
-
120  
-********
121  
-views.py
122  
-********
123  
-                                                    
124  
-We need to provide the view the urlpattern points to::
125  
-
126  
-
127  
-	def newsarticle(request, slug):
128  
-	    """
129  
-	    Responsible for publishing news article
130  
-	    """
131  
-	    newsarticle = get_object_or_404(NewsArticle, slug=slug)
132  
-    
133  
-	    return render_to_response(
134  
-	        "news_and_events/newsarticle.html",
135  
-	        {
136  
-	        "newsarticle":newsarticle,
137  
-	        "entity": newsarticle.hosted_by,
138  
-	        "meta": {"description": newsarticle.summary,}
139  
-	        },
140  
-	        RequestContext(request),
141  
-	        )
142  
-                                        
143  
-
144  
-********************************
145  
-news_and_events/newsarticle.html
146  
-********************************
147  
-
148  
-The best thing to do is to have a look at the actual ``news_and_events/newsarticle.html``.
149  
-
150  
-Same salient points: 
151  
-
152  
-* {% extends newsarticle.get_template %} - see ArkestraGenericModel.get_template, above
153  
-* page furniture, such as the metadata, will be handled by the template it extends 
154  
-
155  
-
156  
-***********
157  
-managers.py
158  
-***********
159  
-
160  
-It's useful to give your model a manager. You don't *need* to, but it helps keep things tidy, and we'll use one in this example. In particular, if you want to make use of the ArkestraGenericPlugin, that makes use of a ``get_items()`` method on your manager.
161  
-
162  
-Inherit the generic model manager::
163  
-
164  
-	from arkestra_utilities.managers import ArkestraGenericModelManager
165  
-
166  
-At present this only contains::
167  
-
168  
-	    def get_by_natural_key(self, slug):
169  
-	        return self.get(slug=slug)
170  
-
171  
-but in the future it might acquire more.
172  
-
173  
-Define your manager and give it a ``get_items()`` method::
174  
-
175  
-	class NewsArticleManager(ArkestraGenericModelManager):
176  
-	    def get_items(self, instance):
177  
-			# just for now, we will return all the objects of this model
178  
-	        return self.model.objects.all()
179  
-
180  
-``get_items()`` can be very complex - see the news_and_events.EventManager for a particularly complex example.
181  
-
182  
-The ``instance`` argument for the manager is actually an instance of the plugin model class, which functions as a reasonably convenient API.
183  
-
184  
-Go back to your model and add an attribute so it knows about the manager::
185  
-
186  
-    objects = NewsArticleManager()
187  
-
188  
-
189  
-**************
190  
-cms_plugins.py
191  
-**************
192  
-
193  
-The simplest kind of plugin isn't even configurable. You just insert it into your content, and let it do its work. We'll start with one of those::
194  
-
195  
-    from arkestra_utilities.generic_models import ArkestraGenericPlugin
196  
-
197  
-ArkestraGenericPlugin refers throughout to ``instance``. 
198  
-
199  
-``instance`` is the class that defines the behaviour of the plugin in this particular instance. If the plugin is configurable, the instance is the model instance as set up in the Admin; if not, it's just an instance of the same model class created for the purpose, but not stored in the database. If we haven't even created sucha model class ourselves, it will be an instance of ``cms.models.pluginmodel.CMSPlugin``.
200  
-
201  
-ArkestraGenericPlugin provides a number of methods, mostly called by ``render()``:
202  
-
203  
-``render(self, context, instance, placeholder)``
204  
-    * works out the entity
205  
-    * assumes the ``type`` of the instance is ``plugin`` if not stated otherwise (e.g. a menu generator, a main page generator)
206  
-    * changes the render_template from ``arkestra/universal_plugin_lister.html`` if required
207  
-    * calls ``set_defaults()`` to set some sensible defaults which may or may not be overridden
208  
-    * calls ``get_items()`` to get items in a list of lists, called ``lists``.
209  
-    * calls ``add_link_to_main_page()`` to see if we need a link to a main page (e.g. the main news and events page)
210  
-    * calls ``add_links_to_other_items()`` to see if we should provide links to archives etc
211  
-    * calls ``set_limits_and_indexes()`` to work out whether we need indexes, or how to truncate lists of items
212  
-    * calls ``determine_layout_settings()`` to set rows/columns and classes for items in the lists
213  
-    * calls ``set_layout_classes()`` to work out the overall structure (rows/columns) of the plugin output
214  
-    Everything it needs to set for the overall information about what's going on in the plugin is set as an attribute of ``instance``, which is then passed to the template as ``everything``. ``lists`` is made an attribute of ``instance``.
215  
-    
216  
-``get_items()`` isn't provided by ArkestraGenericPlugin, except as a dummy that sets an empty ``lists`` - it needs to be provided by whatever subclasses it::
217  
-
218  
-	self.lists = []
219  
-
220  
-
221  
-This is because ArkestraGenericPlugin won't have any idea how to get items - it doesn't know about content.
222  
-
223  
-::
224  
-
225  
-    class CMSNewsAndEventsPlugin(ArkestraGenericPlugin, CMSPluginBase):
226  
-    	# set text_enabled, admin_preview, render_template if the ArkestraGenericPlugin default are not suitable
227  
-
228  
-        # provide an icon for the admin interface
229  
-		def icon_src(self, instance):
230  
-            return "/static/plugin_icons/news_and_events.png"
231  
-
232  
-    plugin_pool.register_plugin(CMSNewsAndEventsPlugin)
233  
-
234  
-You should now be able to insert the plugin into a placeholder, and examine its output - but there won't be anything in there yet, because ``get_items()`` returns ``[]``.
235  
-
236  
-So let's add a method to our plugin::
237  
-
238  
-    def get_items(self, instance):
239  
-        # call the base get_items() to set up our self.lists
240  
-		super(CMSPublicationsPlugin, self).get_items(instance)
241  
-
242  
-        # create a dict to store information about the news articles
243  
-		news_articles = {}
244  
-
245  
-        # put the actual items in it
246  
-		news_articles["items"] = NewsArticle.objects.all()
247  
-
248  
-        # will the plugin publish links to other items (more news, news archive)?
249  
-		news_articles["links_to_other_items"] = self.news_style_other_links
250  
-		
251  
-        # will the plugin publish links to other items (more news, news archive)?
252  
-		news_articles["heading_text"] = instance.news_heading_text
253  
-            
254  
-		# what template will each item in this list use?
255  
-		news_articles["item_template"] = "arkestra/universal_plugin_list_item.html"
256  
-
257  
-
258  
-        self.lists.append(news_articles)
259  
-
260  
-And if we haven't changed ``render_template``, it will use ``arkestra/universal_plugin_lister.html``.  Use ``arkestra/universal_plugin_lister.html`` as a guide to writing your template.
261  
- 
262  
-
263  
-add_link_to_main_page()
264  
-=======================
265  
-                     
266  
-To be completed
267  
-
268  
-*******
269  
-urls.py
270  
-*******
271  
-
272  
-We can use the architecture we have been working with to create an automatic page, for each entity, for this - or these - generic models.
273  
-
274  
-We need a URL pattern for this::
275  
-
276  
-    # named entities' news
277  
-    (r"^news/(?P<slug>[-\w]+)/$", "news.views.news"),
278  
-
279  
-    # base entity's news
280  
-    (r'^news/$', "news.views.news"),    
281  
-
282  
-
283  
-
284  
-********
285  
-views.py
286  
-********
287  
-
288  
-
289  
-
290  
-
291  
-
292  
-*******************
293  
-models.py (again)
294  
-*******************
295  
-
296  
-Now let's create a plugin that we can use to list a number of the items in the model we have created.
297  
-
298  
-We have already imported arkestra_utilities.ArkestraGenericPluginOptions. This provides::
299  
-
300  
-* entity: the entity whose items we'll publish (can usually be left blank; Arkestra will work out what to do)
301  
-* layout: if there are multiple lists (e.g. news and events), will they be stacked or side-by-side?
302  
-* format: title only? details? image?
303  
-* heading_level: above the list there'll be a heading
304  
-* order_by: date alone, or rank by importance too?
305  
-* list format: horizontal or vertical
306  
-* group dates: group lists into sublists (of months, usually)
307  
-* limit_to: how many items - leave blank for no limit
308  
-
309  
-::
310  
-
311  
-	class NewsAndEventsPlugin(CMSPlugin, ArkestraGenericPluginOptions):
312  
-
313  
-Note that this plugin can handle both news and events.
314  
-
315  
-And let's add::
316  
-
317  
-    display = models.CharField("Show", max_length=25,choices = DISPLAY, default = "news events")
318  
-    show_previous_events = models.BooleanField()
319  
-    news_heading_text = models.CharField(max_length=25, default="News")
320  
-    events_heading_text = models.CharField(max_length=25, default="Events")
321  
-
322  
-
323  
-
324  
-
325  
-
326  
-
327  
-
328  
-
329  
-
330  
-class NewsAndEventsPlugin(CMSPlugin, ArkestraGenericPluginOptions):
331  
-
332  
-This is in effect the model for the plugin, and will inherit:
333  
-
334  
-
335  
-form and admin
336  
-==============
337  
-
338  
-from arkestra_utilities.generic_models import ArkestraGenericPlugin, ArkestraGenericPluginForm
339  
-from arkestra_utilities.mixins import AutocompleteMixin
340  
- 
341  
-class PublicationsPluginForm(ArkestraGenericPluginForm, forms.ModelForm):
342  
-    pass
343  
-
344  
-
345  
-class CMSPublicationsPlugin(UniversalPlugin, AutocompleteMixin, CMSPluginBase):
346  
-    model = PublicationsPlugin
347  
-    name = _("Publications")
348  
-    form = PublicationsPluginForm
349  
-    auto_page_attribute = "auto_publications_page"
350  
-    auto_page_slug = "publications"
351  
-    auto_page_menu_title = "publications_page_menu_title"
352  
-    # fieldsets = (
353  
-    #     (None, {
354  
-    #     'fields': (('display', 'layout', 'list_format',),  ( 'format', 'order_by', 'group_dates',), 'limit_to')
355  
-    # }),
356  
-    #     ('Advanced options', {
357  
-    #     'classes': ('collapse',),
358  
-    #     'fields': ('entity', 'heading_level', ('news_heading_text', 'events_heading_text'), ('show_previous_events', ),)
359  
-    # }),
360  
-    # )
361  
-
362  
-    # autocomplete fields
363  
-    related_search_fields = ['entity',]
364  
-
365  
-    def get_items(self, instance):
366  
-        self.lists = []
367  
-
368  
-        this_list = {"model": Publication,}
369  
-        this_list["items"] = Pub.objects.get_items(instance)
370  
-        this_list["links_to_other_items"] = self.news_style_other_links
371  
-        this_list["heading_text"] = instance.news_heading_text
372  
-        this_list["item_template"] = "arkestra/universal_plugin_list_item.html"
373  
-        # the following should *also* check this_list["links_to_other_items"] - 
374  
-        # but then get_items() will need to call self.add_links_to_other_items() itself
375  
-        # this will then mean that news and events pages show two columns if one has links to other items
376  
-        if this_list["items"]: 
377  
-            self.lists.append(this_list)
378  
-
379  
-
380  
-    def icon_src(self, instance):
381  
-        return "/static/plugin_icons/publications_plugin.png"
382  
-
383  
-
384  
-
385  
-
386  
-****
387  
-Menu
388  
-****
389  
-
390  
-Every Entity in the system that has Recordings should have a menu item where they're listed.
391  
-
392  
-For now we will just hardcode a little routine into our menu, contacts_and_people.menu, at the comment "# insert nodes for this Entity":
393  
-
394  
-self.create_new_node(
395  
-    title = "Recordings",
396  
-    url = node.entity.get_related_info_page_url("recordings"), # i.e. /url_of_entity/recordings
397  
-    parent = node, 
398  
-    ) 				
399  
-
400  
-We'll make this more sophisticated later.
401  
-
402  
-***
403  
-URL
404  
-***
405  
-
406  
-We need a URL pattern to match that, so you'll need:
407  
-
408  
-    # named entities' recordings
409  
-    (r"^recordings/(?P<slug>[-\w]+)/$", "recordings.views.recordings"),
410  
-
411  
-    # base entity's vacancies and studentships
412  
-    (r'^recordings/$', "recordings.views.recordings"),    
413  
-
414  
-*****
415  
-Views
416  
-*****
417  
-
418  
-Your URL is looking for a view:
419  
-
420  
-  
421  
-
422  
-
423  
-class MyPluginPublisher(ArkestraGenericPlugin, AutocompleteMixin, CMSPluginBase):
424  
-
425  
-This is in effect the admin for the plugin. Its render() method is what publishes the output. It will inherit:
426  
-
427  
-    How to use and abuse this plugin:
428