Browse files

Merge branch 'develop' of github.com:evildmp/Arkestra into develop

  • Loading branch information...
2 parents e7530e3 + 06860c6 commit ebd798ae3c0bb5adde046ccaa8641855d611d977 @evildmp committed Mar 25, 2013
View
10 arkestra_utilities/generic_models.py
@@ -34,10 +34,12 @@ class Meta:
in_lists = models.BooleanField(_(u"Display in lists"), default=True, db_index=True,
help_text=_(u"If deselected, this item will not appear in lists"))
body = PlaceholderField('body', help_text="Not used or required for external items")
- image = FilerImageField(null=True, blank=True)
+ image = FilerImageField(on_delete=models.SET_NULL, null=True, blank=True)
# universal plugin fields
- hosted_by = models.ForeignKey(Entity, default=Entity.objects.default_entity_id(),
+ hosted_by = models.ForeignKey(Entity,
+ on_delete=models.SET_DEFAULT,
+ default=Entity.objects.default_entity_id(),
related_name='%(class)s_hosted_events', null=True, blank=True,
help_text=u"The entity responsible for publishing this item")
publish_to = models.ManyToManyField(
@@ -112,7 +114,9 @@ def is_uninformative(self):
class ArkestraGenericPluginOptions(models.Model):
class Meta:
abstract = True
- entity = models.ForeignKey(Entity, null=True, blank=True,
+ entity = models.ForeignKey(Entity,
+ on_delete=models.SET_NULL,
+ null=True, blank=True,
help_text="Leave blank for autoselect",
related_name="%(class)s_plugin")
LAYOUTS = (
View
5 arkestra_utilities/mixins.py
@@ -10,7 +10,10 @@ class Meta:
# url fields
url = models.URLField(null=True, blank=True, verify_exists=True,
help_text=u"To be used <strong>only</strong> for external items. Use with caution!")
- external_url = models.ForeignKey(ExternalLink, related_name="%(class)s_item", blank=True, null=True,
+ external_url = models.ForeignKey(ExternalLink,
+ related_name="%(class)s_item",
+ on_delete=models.PROTECT,
+ blank=True, null=True,
help_text=u"Select an item from the External Links database."
)
slug = models.SlugField(unique=True, max_length=60, blank=True, help_text=u"Do not meddle with this unless you know exactly what you're doing!", error_messages={"unique": "unique"})
View
59 arkestra_utilities/models.py
@@ -31,62 +31,3 @@ class Insert(models.Model):
def __unicode__(self):
return self.insertion_point
-
-# from contacts_and_people.models import Entity #, Person, default_entity_id
-# from contacts_and_people.templatetags.entity_tags import work_out_entity
-
-#
-# class ArkestraGenericModel(models.Model):
-# class Meta:
-# abstract = True
-#
-# # core fields
-# title = models.CharField(max_length=255,
-# help_text="e.g. Outrage as man bites dog in unprovoked attack")
-# short_title = models.CharField(max_length=255, null=True, blank=True,
-# help_text= u"e.g. Man bites dog (if left blank, will be copied from Title)")
-# summary = models.TextField(verbose_name="Summary",
-# null=False, blank=False,
-# help_text="e.g. Cardiff man arrested in latest wave of man-on-dog violence (maximum two lines)",)
-# body = PlaceholderField('body', help_text="Not used or required for external items")
-# image = FilerImageField(null=True, blank=True)
-#
-# # universal plugin fields
-# hosted_by = models.ForeignKey(Entity, default=default_entity_id,
-# related_name='%(class)s_hosted_events', null=True, blank=True,
-# help_text=u"The entity responsible for publishing this item")
-# publish_to = models.ManyToManyField(Entity, null=True, blank=True, related_name="%(class)s_publish_to",
-# help_text=u"Use these sensibly - don't send minor items to the home page, for example")
-# please_contact = models.ManyToManyField(Person, related_name='%(class)s_person',
-# help_text=u'The person to whom enquiries about this should be directed ',
-# null=True, blank=True)
-# IMPORTANCES = (
-# (0, u"Normal"),
-# (1, u"More important"),
-# (10, u"Most important"),
-# )
-# importance = models.PositiveIntegerField(null=True, blank=False,
-# default=0, choices=IMPORTANCES,
-# help_text=u"Important items will be featured in lists")
-#
-# def get_importance(self):
-# if self.importance: # if they are not being gathered together, mark them as important
-# return "important"
-# else:
-# return ""
-#
-# @property
-# def links(self):
-# return self.object_links_set.all()
-#
-# @property
-# def external_url(self):
-# # if the inheriting model doesn't have an external_url attribute, we'll give it a None one just in case this is needed
-# return None
-#
-# @property
-# def is_uninformative(self):
-# if self.external_url or self.body.cmsplugin_set.all() or self.please_contact.all() or self.links:
-# return False
-# else:
-# return True
View
377 ...migrations/0006_auto__chg_field_entity_image__chg_field_entity_external_url__chg_field.py
@@ -0,0 +1,377 @@
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Changing field 'Entity.image'
+ db.alter_column('contacts_and_people_entity', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, on_delete=models.SET_NULL))
+
+ # Changing field 'Entity.external_url'
+ db.alter_column('contacts_and_people_entity', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['links.ExternalLink']))
+
+ # Changing field 'Membership.display_role'
+ db.alter_column('contacts_and_people_membership', 'display_role_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['contacts_and_people.Membership']))
+
+ # Changing field 'Building.image'
+ db.alter_column('contacts_and_people_building', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, on_delete=models.SET_NULL))
+
+ # Changing field 'Building.site'
+ db.alter_column('contacts_and_people_building', 'site_id', self.gf('django.db.models.fields.related.ForeignKey')(on_delete=models.PROTECT, to=orm['contacts_and_people.Site']))
+
+ # Changing field 'Person.image'
+ db.alter_column('contacts_and_people_person', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, on_delete=models.SET_NULL))
+
+ # Changing field 'Person.user'
+ db.alter_column('contacts_and_people_person', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['auth.User'], unique=True))
+
+ # Changing field 'Person.external_url'
+ db.alter_column('contacts_and_people_person', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['links.ExternalLink']))
+
+ def backwards(self, orm):
+
+ # Changing field 'Entity.image'
+ db.alter_column('contacts_and_people_entity', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True))
+
+ # Changing field 'Entity.external_url'
+ db.alter_column('contacts_and_people_entity', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['links.ExternalLink']))
+
+ # Changing field 'Membership.display_role'
+ db.alter_column('contacts_and_people_membership', 'display_role_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['contacts_and_people.Membership']))
+
+ # Changing field 'Building.image'
+ db.alter_column('contacts_and_people_building', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True))
+
+ # Changing field 'Building.site'
+ db.alter_column('contacts_and_people_building', 'site_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contacts_and_people.Site']))
+
+ # Changing field 'Person.image'
+ db.alter_column('contacts_and_people_person', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True))
+
+ # Changing field 'Person.user'
+ db.alter_column('contacts_and_people_person', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['auth.User'], unique=True))
+
+ # Changing field 'Person.external_url'
+ db.alter_column('contacts_and_people_person', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['links.ExternalLink']))
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ '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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ '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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ '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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'cms.cmsplugin': {
+ 'Meta': {'object_name': 'CMSPlugin'},
+ 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 3, 22, 0, 0)'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+ 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+ 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+ 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'cms.page': {
+ 'Meta': {'ordering': "('site', 'tree_id', 'lft')", 'object_name': 'Page'},
+ 'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+ 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'in_navigation': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'limit_visibility_in_menu': ('django.db.models.fields.SmallIntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}),
+ 'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'moderator_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '1', 'blank': 'True'}),
+ 'navigation_extenders': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
+ 'page_flags': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['cms.Page']"}),
+ 'placeholders': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cms.Placeholder']", 'symmetrical': 'False'}),
+ 'publication_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'publication_end_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'published': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
+ 'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.Page']"}),
+ 'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}),
+ 'reverse_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '40', 'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
+ 'soft_root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'template': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'cms.placeholder': {
+ 'Meta': {'object_name': 'Placeholder'},
+ 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+ },
+ 'contacts_and_people.building': {
+ 'Meta': {'ordering': "('site', 'street', 'number', 'name')", 'object_name': 'Building'},
+ 'access_and_parking': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'building_access_and_parking'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'additional_street_address': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'building_description'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'getting_here': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'getting_here'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'map': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'number': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'postcode': ('django.db.models.fields.CharField', [], {'max_length': '9', 'null': 'True', 'blank': 'True'}),
+ 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'place'", 'on_delete': 'models.PROTECT', 'to': "orm['contacts_and_people.Site']"}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
+ 'street': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'summary': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '256'}),
+ 'zoom': ('django.db.models.fields.IntegerField', [], {'default': '17', 'null': 'True', 'blank': 'True'})
+ },
+ 'contacts_and_people.entity': {
+ 'Meta': {'ordering': "['tree_id', 'lft']", 'object_name': 'Entity', '_ormbases': ['contacts_and_people.EntityLite']},
+ 'abstract_entity': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'access_note': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'auto_contacts_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'auto_news_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'auto_vacancies_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'building': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Building']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'building_recapitulates_entity_name': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'contacts_page_intro': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contacts_page_intro'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'contacts_page_menu_title': ('django.db.models.fields.CharField', [], {'default': "'Contacts & people'", 'max_length': '50'}),
+ 'display_parent': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+ 'entitylite_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['contacts_and_people.EntityLite']", 'unique': 'True', 'primary_key': 'True'}),
+ 'external_url': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'entity_item'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalLink']"}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'news_page_intro': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'news_page_intro'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'news_page_menu_title': ('django.db.models.fields.CharField', [], {'default': "'News & events'", 'max_length': '50'}),
+ 'parent': ('mptt.fields.TreeForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['contacts_and_people.Entity']"}),
+ 'precise_location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'short_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '60', 'blank': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'vacancies_page_intro': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vacancies_page_intro'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'vacancies_page_menu_title': ('django.db.models.fields.CharField', [], {'default': "'Vacancies & studentships'", 'max_length': '50'}),
+ 'website': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entity'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['cms.Page']", 'blank': 'True', 'unique': 'True'})
+ },
+ 'contacts_and_people.entityautopagelinkplugineditor': {
+ 'Meta': {'object_name': 'EntityAutoPageLinkPluginEditor', 'db_table': "'cmsplugin_entityautopagelinkplugineditor'", '_ormbases': ['cms.CMSPlugin']},
+ 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+ 'entity': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'auto_page_plugin'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Entity']"}),
+ 'link_to': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'text_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
+ },
+ 'contacts_and_people.entitydirectoryplugineditor': {
+ 'Meta': {'object_name': 'EntityDirectoryPluginEditor', 'db_table': "'cmsplugin_entitydirectoryplugineditor'", '_ormbases': ['cms.CMSPlugin']},
+ 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+ 'display_descriptions_to_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'null': 'True', 'blank': 'True'}),
+ 'entity': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'directory_plugin'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Entity']"}),
+ 'levels': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'link_icons': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'use_short_names': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
+ },
+ 'contacts_and_people.entitylite': {
+ 'Meta': {'object_name': 'EntityLite'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'contacts_and_people.entitymembersplugineditor': {
+ 'Meta': {'object_name': 'EntityMembersPluginEditor', 'db_table': "'cmsplugin_entitymembersplugineditor'", '_ormbases': ['cms.CMSPlugin']},
+ 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+ 'entity': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'entity_members_plugin'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Entity']"})
+ },
+ 'contacts_and_people.membership': {
+ 'Meta': {'ordering': "('-importance_to_entity', 'person__surname')", 'object_name': 'Membership'},
+ 'display_role': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'display_roles'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Membership']"}),
+ 'entity': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'members'", 'to': "orm['contacts_and_people.Entity']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'importance_to_entity': ('django.db.models.fields.IntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
+ 'importance_to_person': ('django.db.models.fields.IntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
+ 'key_contact': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'member_of'", 'to': "orm['contacts_and_people.Person']"}),
+ 'role': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
+ },
+ 'contacts_and_people.person': {
+ 'Meta': {'ordering': "['surname', 'given_name', 'user']", 'object_name': 'Person', '_ormbases': ['contacts_and_people.PersonLite']},
+ 'access_note': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'building': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Building']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'data_feed_locked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'description': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+ 'entities': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'people'", 'to': "orm['contacts_and_people.Entity']", 'through': "orm['contacts_and_people.Membership']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True'}),
+ 'external_url': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'person_item'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalLink']"}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'institutional_username': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'override_entity': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'people_override'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Entity']"}),
+ 'personlite_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['contacts_and_people.PersonLite']", 'unique': 'True', 'primary_key': 'True'}),
+ 'please_contact': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'contact_for'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Person']"}),
+ 'precise_location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '60', 'blank': 'True'}),
+ 'staff_id': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'person_user'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['auth.User']", 'blank': 'True', 'unique': 'True'})
+ },
+ 'contacts_and_people.personlite': {
+ 'Meta': {'object_name': 'PersonLite'},
+ 'given_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'middle_names': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Title']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'})
+ },
+ 'contacts_and_people.phonecontact': {
+ 'Meta': {'ordering': "('label',)", 'object_name': 'PhoneContact'},
+ 'area_code': ('django.db.models.fields.CharField', [], {'default': "'029'", 'max_length': '5'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'country_code': ('django.db.models.fields.CharField', [], {'default': "'44'", 'max_length': '5'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'internal_extension': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}),
+ 'number': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+ 'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'})
+ },
+ 'contacts_and_people.site': {
+ 'Meta': {'ordering': "('country', 'site_name', 'post_town')", 'object_name': 'Site'},
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'description': ('django.db.models.fields.TextField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'post_town': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'site_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ 'contacts_and_people.teacher': {
+ 'Meta': {'object_name': 'Teacher'},
+ 'dummy_field_one': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'dummy_field_two': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'person': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'teacher'", 'unique': 'True', 'null': 'True', 'to': "orm['contacts_and_people.Person']"})
+ },
+ 'contacts_and_people.title': {
+ 'Meta': {'ordering': "['title']", 'object_name': 'Title'},
+ 'abbreviation': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ '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'}),
+ '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'})
+ },
+ 'filer.file': {
+ 'Meta': {'object_name': 'File'},
+ '_file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'folder': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'all_files'", 'null': 'True', 'to': "orm['filer.Folder']"}),
+ 'has_all_mandatory_data': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'original_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'polymorphic_filer.file_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
+ 'sha1': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40', 'blank': 'True'}),
+ 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+ },
+ 'filer.folder': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('parent', 'name'),)", 'object_name': 'Folder'},
+ 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['filer.Folder']"}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+ },
+ 'filer.image': {
+ 'Meta': {'object_name': 'Image', '_ormbases': ['filer.File']},
+ '_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ '_width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'default_alt_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'default_caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'file_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['filer.File']", 'unique': 'True', 'primary_key': 'True'}),
+ 'must_always_publish_author_credit': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'must_always_publish_copyright': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'subject_location': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'blank': 'True'})
+ },
+ 'links.externallink': {
+ 'Meta': {'ordering': "['title']", 'object_name': 'ExternalLink'},
+ 'description': ('django.db.models.fields.TextField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'external_site': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'links'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalSite']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'kind': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'links'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['links.LinkType']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
+ 'url': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'links.externalsite': {
+ 'Meta': {'ordering': "['domain']", 'object_name': 'ExternalSite'},
+ 'domain': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['links.ExternalSite']"}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'site': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'links.linktype': {
+ 'Meta': {'object_name': 'LinkType'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'scheme': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ 'sites.site': {
+ 'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
+ 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['contacts_and_people']
View
86 contacts_and_people/models.py
@@ -61,10 +61,13 @@ class Building(models.Model):
additional_street_address = models.CharField(help_text=u"If required",
max_length=100, null=True, blank=True)
postcode = models.CharField(max_length=9, null=True, blank=True)
- site = models.ForeignKey(Site, related_name="place")
+ site = models.ForeignKey(Site,
+ on_delete=models.PROTECT,
+ related_name="place")
slug = models.SlugField(blank=True, help_text=u"Please leave blank/amend only if required",
max_length=255, null=True, unique=True)
- image = FilerImageField(null=True, blank=True)
+ image = FilerImageField(on_delete=models.SET_NULL,
+ null=True, blank=True)
# for the place page
summary = models.TextField(verbose_name="Summary", max_length=256, default ="",
help_text="A very short description of this building (maximum two lines)",)
@@ -206,7 +209,7 @@ class CommonFields(URLModelMixin):
max_length=255, null=True, blank=True)
email = models.EmailField(verbose_name="Email address", null=True, blank=True)
phone_contacts = generic.GenericRelation(PhoneContact)
- image = FilerImageField(null=True, blank=True)
+ image = FilerImageField(on_delete=models.SET_NULL, null=True, blank=True)
class Meta:
abstract = True
@@ -262,7 +265,9 @@ class Entity(MPTTModel, EntityLite, CommonFields):
display_parent = models.BooleanField(u"Include parent entity's name in address", default=True, help_text=u"Deselect if this entity recapitulates its parent's name")
building_recapitulates_entity_name = models.BooleanField(default=False,
help_text=u"Removes the first line of the address - use to avoid, for example:<br /><em>Department of Haematology<br />Haematology Building<br />...</em>")
- building = models.ForeignKey(Building, null=True, blank=True, on_delete=models.SET_NULL,
+ building = models.ForeignKey(Building,
+ null=True, blank=True,
+ on_delete=models.SET_NULL,
help_text=u"Select the place where this Entity is based",)
website = models.ForeignKey(Page, verbose_name="Home page",
related_name='entity', unique=True, null=True, blank=True,
@@ -440,7 +445,7 @@ def get_contacts(self):
"""
Return designated contacts for the entity
"""
- contacts = Membership.objects.filter(entity = self, key_contact = True).order_by('importance_to_entity')
+ contacts = Membership.objects.filter(entity=self, person__active=True, key_contact=True).order_by('importance_to_entity')
return contacts
def get_people_with_roles(self, key_members_only = False):
@@ -450,8 +455,11 @@ def get_people_with_roles(self, key_members_only = False):
Ranks roles by importance to entity, then gathers people under that role
Optionally, will return *all* members with roles
- """
- memberships = Membership.objects.filter(entity = self).exclude(role ="").order_by('-importance_to_entity','person__surname',)
+ """
+ memberships = Membership.objects.\
+ filter(entity=self,person__active=True).\
+ exclude(role ="").\
+ order_by('-importance_to_entity','person__surname',)
if key_members_only:
memberships = memberships.filter(importance_to_entity__gte = 3)
# create a set with which to check for duplicates
@@ -497,14 +505,16 @@ def get_roles_for_members(self, members):
member.membership = unnamed_memberships[0]
return members
- def get_people(self, letter = None):
+ def get_people(self, letter=None):
"""
Publishes a list of every member, and of every member of all children
"""
+ people = Person.objects.filter(active=True, member_of__entity__in=self.get_descendants(include_self=True)). \
+ order_by('surname', 'given_name', 'middle_names').distinct()
+
if letter:
- people = Person.objects.filter(member_of__entity__in = self.get_descendants(include_self = True), surname__istartswith = letter).distinct().order_by('surname', 'given_name', 'middle_names')
- else:
- people = Person.objects.filter(member_of__entity__in = self.get_descendants(include_self = True)).distinct().order_by('surname', 'given_name', 'middle_names')
+ people = people.filter(surname__istartswith = letter)
+
return people
def get_people_and_initials(self, letter = None):
@@ -543,7 +553,8 @@ def __unicode__(self):
class PersonLite(models.Model):
title = models.ForeignKey('contacts_and_people.Title',
- blank=True, null=True, on_delete=models.SET_NULL)
+ blank=True, null=True,
+ on_delete=models.SET_NULL)
given_name = models.CharField(max_length=50, blank=True, null=True)
middle_names = models.CharField(max_length=100, blank=True, null=True)
surname = models.CharField(max_length=50)
@@ -569,21 +580,33 @@ def get_by_natural_key(self, slug):
class Person(PersonLite, CommonFields):
objects=PersonManager()
- user = models.ForeignKey(User, related_name='person_user', unique=True,
- blank=True, null=True, verbose_name='Arkestra User', on_delete=models.SET_NULL)
+ user = models.ForeignKey(User,
+ related_name='person_user',
+ unique=True,
+ blank=True, null=True,
+ verbose_name='Arkestra User',
+ on_delete=models.PROTECT)
institutional_username = models.CharField(max_length=10, blank=True, null=True)
active = models.BooleanField(default=True,)
description = PlaceholderField('body')
entities = models.ManyToManyField(Entity, related_name='people',
through='Membership', blank=True, null=True)
- building = models.ForeignKey(Building, verbose_name='Specify building',
+ building = models.ForeignKey(Building,
+ verbose_name='Specify building',
help_text=u"<strong>Only</strong> required if this Person's <strong>Home entity</strong> has a different address",
- blank=True, null=True, on_delete=models.SET_NULL)
- override_entity = models.ForeignKey(Entity, verbose_name='Specify entity',
+ blank=True, null=True,
+ on_delete=models.SET_NULL)
+ override_entity = models.ForeignKey(
+ Entity, verbose_name='Specify entity',
help_text=u"<strong>Temporarily specify</strong> an entity for contact information - over-rides entity and postal address",
- related_name='people_override', blank=True, null=True, on_delete=models.SET_NULL)
- please_contact = models.ForeignKey('self', help_text=u"Publish another person's details as contact information for this person",
- related_name='contact_for', blank=True, null=True, on_delete=models.SET_NULL)
+ related_name='people_override',
+ blank=True, null=True,
+ on_delete=models.SET_NULL)
+ please_contact = models.ForeignKey('self',
+ help_text=u"Publish another person's details as contact information for this person",
+ related_name='contact_for',
+ blank=True, null=True,
+ on_delete=models.SET_NULL)
staff_id = models.CharField(null=True, blank=True, max_length=20)
data_feed_locked = models.BooleanField(default=False)
@@ -599,10 +622,11 @@ def __unicode__(self):
return u" ".join(name_part for name_part in [unicode(title), self.given_name, self.surname] if name_part)
def get_absolute_url(self):
- if self.external_url:
- return self.external_url.url
- else:
- return "/person/%s/" % self.slug
+ if self.active:
+ if self.external_url:
+ return self.external_url.url
+ else:
+ return "/person/%s/" % self.slug
@property
def get_role(self):
@@ -616,7 +640,7 @@ def get_role(self):
If it can't find any role, it returns None.
"""
memberships = Membership.objects.filter(
- person = self,
+ person=self,
entity__abstract_entity = False,
importance_to_person__gte = 2).order_by('-importance_to_person'
)
@@ -739,8 +763,10 @@ class Membership(models.Model):
person = models.ForeignKey(Person, related_name='member_of')
entity = models.ForeignKey(Entity, related_name='members')
# this is currently too complex to manage - in this version it remains unused
- display_role = models.ForeignKey('self', related_name="display_roles",
- null=True, blank=True)
+ display_role = models.ForeignKey('self',
+ related_name="display_roles",
+ null=True, blank=True,
+ on_delete=models.SET_NULL)
key_contact = models.BooleanField(default=False)
role = models.CharField(max_length=50, null=True, blank=True)
# how important the role is to the person
@@ -804,7 +830,8 @@ class EntityAutoPageLinkPluginEditor(CMSPlugin):
link_to = models.CharField(max_length=50, choices=[(x, y[0]) for x, y in sorted(AUTO_PAGES.items())])
entity = models.ForeignKey(Entity, null=True, blank=True,
help_text="Leave blank for autoselect",
- related_name="auto_page_plugin", on_delete=models.SET_NULL)
+ related_name="auto_page_plugin",
+ on_delete=models.SET_NULL)
text_override = models.CharField(max_length=256, null=True, blank=True,
help_text="Override the default link text")
@@ -831,7 +858,8 @@ class EntityDirectoryPluginEditor(CMSPlugin):
class EntityMembersPluginEditor(CMSPlugin):
entity = models.ForeignKey(Entity, null=True, blank=True,
help_text="Leave blank for autoselect",
- related_name="entity_members_plugin", on_delete=models.SET_NULL)
+ related_name="entity_members_plugin",
+ on_delete=models.SET_NULL)
# try:
# mptt.register(Entity)
View
2 contacts_and_people/views.py
@@ -120,7 +120,7 @@ def person(request, slug, active_tab=""):
"""
Responsible for the person pages
"""
- person = get_object_or_404(Person,slug=slug)
+ person = get_object_or_404(Person, slug=slug, active=True)
person.links = object_links(person)
# we have a home_role, but we should also provide a role, even where it's good enough to give us an address
home_role = person.get_role
View
229 ...migrations/0004_auto__chg_field_externallink_kind__chg_field_externallink_external_sit.py
@@ -0,0 +1,229 @@
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Changing field 'ExternalLink.kind'
+ db.alter_column('links_externallink', 'kind_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['links.LinkType']))
+
+ # Changing field 'ExternalLink.external_site'
+ db.alter_column('links_externallink', 'external_site_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['links.ExternalSite']))
+
+ def backwards(self, orm):
+
+ # Changing field 'ExternalLink.kind'
+ db.alter_column('links_externallink', 'kind_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['links.LinkType']))
+
+ # Changing field 'ExternalLink.external_site'
+ db.alter_column('links_externallink', 'external_site_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['links.ExternalSite']))
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ '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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ '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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ '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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'cms.cmsplugin': {
+ 'Meta': {'object_name': 'CMSPlugin'},
+ 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 3, 22, 0, 0)'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+ 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+ 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+ 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'cms.placeholder': {
+ 'Meta': {'object_name': 'Placeholder'},
+ 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+ },
+ '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'}),
+ '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'})
+ },
+ 'filer.file': {
+ 'Meta': {'object_name': 'File'},
+ '_file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'folder': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'all_files'", 'null': 'True', 'to': "orm['filer.Folder']"}),
+ 'has_all_mandatory_data': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'original_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'polymorphic_filer.file_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
+ 'sha1': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40', 'blank': 'True'}),
+ 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+ },
+ 'filer.folder': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('parent', 'name'),)", 'object_name': 'Folder'},
+ 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['filer.Folder']"}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+ },
+ 'filer.image': {
+ 'Meta': {'object_name': 'Image', '_ormbases': ['filer.File']},
+ '_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ '_width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'default_alt_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'default_caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'file_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['filer.File']", 'unique': 'True', 'primary_key': 'True'}),
+ 'must_always_publish_author_credit': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'must_always_publish_copyright': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'subject_location': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'blank': 'True'})
+ },
+ 'links.carouselplugin': {
+ 'Meta': {'object_name': 'CarouselPlugin', 'db_table': "'cmsplugin_carouselplugin'", '_ormbases': ['cms.CMSPlugin']},
+ 'aspect_ratio': ('django.db.models.fields.FloatField', [], {'default': '1.5', 'null': 'True', 'blank': 'True'}),
+ 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'width': ('django.db.models.fields.FloatField', [], {'default': '100.0'})
+ },
+ 'links.carouselpluginitem': {
+ 'Meta': {'ordering': "['inline_item_ordering', 'id']", 'object_name': 'CarouselPluginItem'},
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'destination_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'links_to_carouselpluginitem'", 'to': "orm['contenttypes.ContentType']"}),
+ 'destination_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']"}),
+ 'inline_item_ordering': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
+ 'link_title': ('django.db.models.fields.CharField', [], {'max_length': '35'}),
+ 'plugin': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'carousel_item'", 'to': "orm['links.CarouselPlugin']"})
+ },
+ 'links.externallink': {
+ 'Meta': {'ordering': "['title']", 'object_name': 'ExternalLink'},
+ 'description': ('django.db.models.fields.TextField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'external_site': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'links'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalSite']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'kind': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'links'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['links.LinkType']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
+ 'url': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'links.externalsite': {
+ 'Meta': {'ordering': "['domain']", 'object_name': 'ExternalSite'},
+ 'domain': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['links.ExternalSite']"}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'site': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'links.focusonplugineditor': {
+ 'Meta': {'object_name': 'FocusOnPluginEditor', 'db_table': "'cmsplugin_focusonplugineditor'", '_ormbases': ['cms.CMSPlugin']},
+ 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+ 'heading_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '2'})
+ },
+ 'links.focusonpluginitemeditor': {
+ 'Meta': {'ordering': "['id']", 'object_name': 'FocusOnPluginItemEditor'},
+ 'description_override': ('django.db.models.fields.TextField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'destination_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'links_to_focusonpluginitemeditor'", 'to': "orm['contenttypes.ContentType']"}),
+ 'destination_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image_override': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'blank': 'True'}),
+ 'plugin': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'focuson_item'", 'to': "orm['links.FocusOnPluginEditor']"}),
+ 'short_text_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'text_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
+ },
+ 'links.genericlinklistplugin': {
+ 'Meta': {'object_name': 'GenericLinkListPlugin', 'db_table': "'cmsplugin_genericlinklistplugin'", '_ormbases': ['cms.CMSPlugin']},
+ 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+ 'final_separator': ('django.db.models.fields.CharField', [], {'default': "' and '", 'max_length': '20', 'null': 'True', 'blank': 'True'}),
+ 'insert_as': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}),
+ 'separator': ('django.db.models.fields.CharField', [], {'default': "', '", 'max_length': '20', 'null': 'True', 'blank': 'True'}),
+ 'use_link_icons': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
+ },
+ 'links.genericlinklistpluginitem': {
+ 'Meta': {'ordering': "['inline_item_ordering', 'id']", 'object_name': 'GenericLinkListPluginItem'},
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'description_override': ('django.db.models.fields.TextField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'destination_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'links_to_genericlinklistpluginitem'", 'to': "orm['contenttypes.ContentType']"}),
+ 'destination_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'heading_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'html_title_attribute': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'include_description': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'inline_item_ordering': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
+ 'key_link': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'metadata_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'plugin': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'links_item'", 'to': "orm['links.GenericLinkListPlugin']"}),
+ 'text_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
+ },
+ 'links.linktype': {
+ 'Meta': {'object_name': 'LinkType'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'scheme': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ 'links.objectlink': {
+ 'Meta': {'object_name': 'ObjectLink'},
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'description_override': ('django.db.models.fields.TextField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'destination_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'links_to_objectlink'", 'to': "orm['contenttypes.ContentType']"}),
+ 'destination_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'heading_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'html_title_attribute': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'include_description': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'key_link': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'metadata_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'text_override': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
+ }
+ }
+
+ complete_apps = ['links']
View
7 links/models.py
@@ -165,9 +165,12 @@ class ExternalLink(models.Model):
# this would have unique = True, but it makes it too hard to migrate from databases with duplicates
url = models.CharField(max_length=255)
external_site = models.ForeignKey('ExternalSite', related_name="links",
- null=True, blank=True)
+ null=True, blank=True,
+ on_delete=models.PROTECT)
description = models.TextField(max_length=256, null=True, blank=True)
- kind = models.ForeignKey('LinkType', blank=True, null = True, related_name='links')
+ kind = models.ForeignKey('LinkType',
+ blank=True, null = True, on_delete=models.SET_NULL,
+ related_name='links')
class Meta:
ordering = ['title',]
View
2 news_and_events/admin.py
@@ -207,7 +207,7 @@ class EventAdmin(NewsAndEventsAdmin, TreeAdmin):
list_display = ('short_title', 'hosted_by', 'start_date')
list_editable = ()
search_fields = ['title']
- list_filter = (EventIsSeries,)
+ list_filter = (EventIsSeries, 'start_date')
save_as = True
# autocomplete fields
related_search_fields = ['hosted_by','parent','building', 'external_url']
View
452 ...migrations/0002_auto__chg_field_newsandeventsplugin_entity__chg_field_event_image__chg.py
@@ -0,0 +1,452 @@
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Changing field 'NewsAndEventsPlugin.entity'
+ db.alter_column('cmsplugin_newsandeventsplugin', 'entity_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['contacts_and_people.Entity']))
+
+ # Changing field 'Event.image'
+ db.alter_column('news_and_events_event', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, on_delete=models.SET_NULL))
+
+ # Changing field 'Event.parent'
+ db.alter_column('news_and_events_event', 'parent_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['news_and_events.Event']))
+
+ # Changing field 'Event.type'
+ db.alter_column('news_and_events_event', 'type_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['news_and_events.EventType'], on_delete=models.PROTECT))
+
+ # Changing field 'Event.hosted_by'
+ db.alter_column('news_and_events_event', 'hosted_by_id', self.gf('django.db.models.fields.related.ForeignKey')(on_delete=models.SET_DEFAULT, to=orm['contacts_and_people.Entity'], null=True))
+
+ # Changing field 'Event.building'
+ db.alter_column('news_and_events_event', 'building_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contacts_and_people.Building'], null=True, on_delete=models.SET_NULL))
+
+ # Changing field 'Event.external_url'
+ db.alter_column('news_and_events_event', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['links.ExternalLink']))
+
+ # Changing field 'NewsArticle.hosted_by'
+ db.alter_column('news_and_events_newsarticle', 'hosted_by_id', self.gf('django.db.models.fields.related.ForeignKey')(on_delete=models.SET_DEFAULT, to=orm['contacts_and_people.Entity'], null=True))
+
+ # Changing field 'NewsArticle.image'
+ db.alter_column('news_and_events_newsarticle', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, on_delete=models.SET_NULL))
+
+ # Changing field 'NewsArticle.external_url'
+ db.alter_column('news_and_events_newsarticle', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.PROTECT, to=orm['links.ExternalLink']))
+
+ def backwards(self, orm):
+
+ # Changing field 'NewsAndEventsPlugin.entity'
+ db.alter_column('cmsplugin_newsandeventsplugin', 'entity_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['contacts_and_people.Entity']))
+
+ # Changing field 'Event.image'
+ db.alter_column('news_and_events_event', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True))
+
+ # Changing field 'Event.parent'
+ db.alter_column('news_and_events_event', 'parent_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['news_and_events.Event']))
+
+ # Changing field 'Event.type'
+ db.alter_column('news_and_events_event', 'type_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['news_and_events.EventType']))
+
+ # Changing field 'Event.hosted_by'
+ db.alter_column('news_and_events_event', 'hosted_by_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['contacts_and_people.Entity']))
+
+ # Changing field 'Event.building'
+ db.alter_column('news_and_events_event', 'building_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contacts_and_people.Building'], null=True))
+
+ # Changing field 'Event.external_url'
+ db.alter_column('news_and_events_event', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['links.ExternalLink']))
+
+ # Changing field 'NewsArticle.hosted_by'
+ db.alter_column('news_and_events_newsarticle', 'hosted_by_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['contacts_and_people.Entity']))
+
+ # Changing field 'NewsArticle.image'
+ db.alter_column('news_and_events_newsarticle', 'image_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True))
+
+ # Changing field 'NewsArticle.external_url'
+ db.alter_column('news_and_events_newsarticle', 'external_url_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['links.ExternalLink']))
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ '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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ '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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ '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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'cms.cmsplugin': {
+ 'Meta': {'object_name': 'CMSPlugin'},
+ 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 3, 22, 0, 0)'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+ 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+ 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+ 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'cms.page': {
+ 'Meta': {'ordering': "('site', 'tree_id', 'lft')", 'object_name': 'Page'},
+ 'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+ 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'in_navigation': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'limit_visibility_in_menu': ('django.db.models.fields.SmallIntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}),
+ 'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'moderator_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '1', 'blank': 'True'}),
+ 'navigation_extenders': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
+ 'page_flags': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['cms.Page']"}),
+ 'placeholders': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cms.Placeholder']", 'symmetrical': 'False'}),
+ 'publication_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'publication_end_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'published': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
+ 'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.Page']"}),
+ 'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}),
+ 'reverse_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '40', 'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
+ 'soft_root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'template': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'cms.placeholder': {
+ 'Meta': {'object_name': 'Placeholder'},
+ 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+ },
+ 'contacts_and_people.building': {
+ 'Meta': {'ordering': "('site', 'street', 'number', 'name')", 'object_name': 'Building'},
+ 'access_and_parking': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'building_access_and_parking'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'additional_street_address': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'building_description'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'getting_here': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'getting_here'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'map': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'number': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'postcode': ('django.db.models.fields.CharField', [], {'max_length': '9', 'null': 'True', 'blank': 'True'}),
+ 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'place'", 'on_delete': 'models.PROTECT', 'to': "orm['contacts_and_people.Site']"}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
+ 'street': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'summary': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '256'}),
+ 'zoom': ('django.db.models.fields.IntegerField', [], {'default': '17', 'null': 'True', 'blank': 'True'})
+ },
+ 'contacts_and_people.entity': {
+ 'Meta': {'ordering': "['tree_id', 'lft']", 'object_name': 'Entity', '_ormbases': ['contacts_and_people.EntityLite']},
+ 'abstract_entity': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'access_note': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'auto_contacts_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'auto_news_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'auto_vacancies_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'building': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Building']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'building_recapitulates_entity_name': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'contacts_page_intro': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contacts_page_intro'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'contacts_page_menu_title': ('django.db.models.fields.CharField', [], {'default': "'Contacts & people'", 'max_length': '50'}),
+ 'display_parent': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+ 'entitylite_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['contacts_and_people.EntityLite']", 'unique': 'True', 'primary_key': 'True'}),
+ 'external_url': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'entity_item'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalLink']"}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'news_page_intro': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'news_page_intro'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'news_page_menu_title': ('django.db.models.fields.CharField', [], {'default': "'News & events'", 'max_length': '50'}),
+ 'parent': ('mptt.fields.TreeForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['contacts_and_people.Entity']"}),
+ 'precise_location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'short_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '60', 'blank': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'vacancies_page_intro': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vacancies_page_intro'", 'null': 'True', 'to': "orm['cms.Placeholder']"}),
+ 'vacancies_page_menu_title': ('django.db.models.fields.CharField', [], {'default': "'Vacancies & studentships'", 'max_length': '50'}),
+ 'website': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entity'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['cms.Page']", 'blank': 'True', 'unique': 'True'})
+ },
+ 'contacts_and_people.entitylite': {
+ 'Meta': {'object_name': 'EntityLite'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'contacts_and_people.membership': {
+ 'Meta': {'ordering': "('-importance_to_entity', 'person__surname')", 'object_name': 'Membership'},
+ 'display_role': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'display_roles'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Membership']"}),
+ 'entity': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'members'", 'to': "orm['contacts_and_people.Entity']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'importance_to_entity': ('django.db.models.fields.IntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
+ 'importance_to_person': ('django.db.models.fields.IntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
+ 'key_contact': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'member_of'", 'to': "orm['contacts_and_people.Person']"}),
+ 'role': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
+ },
+ 'contacts_and_people.person': {
+ 'Meta': {'ordering': "['surname', 'given_name', 'user']", 'object_name': 'Person', '_ormbases': ['contacts_and_people.PersonLite']},
+ 'access_note': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'building': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Building']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'data_feed_locked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'description': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+ 'entities': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'people'", 'to': "orm['contacts_and_people.Entity']", 'through': "orm['contacts_and_people.Membership']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True'}),
+ 'external_url': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'person_item'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalLink']"}),
+ 'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'institutional_username': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'override_entity': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'people_override'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Entity']"}),
+ 'personlite_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['contacts_and_people.PersonLite']", 'unique': 'True', 'primary_key': 'True'}),
+ 'please_contact': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'contact_for'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['contacts_and_people.Person']"}),
+ 'precise_location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '60', 'blank': 'True'}),
+ 'staff_id': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'person_user'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['auth.User']", 'blank': 'True', 'unique': 'True'})
+ },
+ 'contacts_and_people.personlite': {
+ 'Meta': {'object_name': 'PersonLite'},
+ 'given_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'middle_names': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Title']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'})
+ },
+ 'contacts_and_people.phonecontact': {
+ 'Meta': {'ordering': "('label',)", 'object_name': 'PhoneContact'},
+ 'area_code': ('django.db.models.fields.CharField', [], {'default': "'029'", 'max_length': '5'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'country_code': ('django.db.models.fields.CharField', [], {'default': "'44'", 'max_length': '5'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'internal_extension': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}),
+ 'number': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+ 'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'})
+ },
+ 'contacts_and_people.site': {
+ 'Meta': {'ordering': "('country', 'site_name', 'post_town')", 'object_name': 'Site'},
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'description': ('django.db.models.fields.TextField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'post_town': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'site_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ 'contacts_and_people.title': {
+ 'Meta': {'ordering': "['title']", 'object_name': 'Title'},
+ 'abbreviation': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ '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'}),
+ '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'})
+ },
+ 'filer.file': {
+ 'Meta': {'object_name': 'File'},
+ '_file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'folder': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'all_files'", 'null': 'True', 'to': "orm['filer.Folder']"}),
+ 'has_all_mandatory_data': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'original_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'polymorphic_filer.file_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
+ 'sha1': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40', 'blank': 'True'}),
+ 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+ },
+ 'filer.folder': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('parent', 'name'),)", 'object_name': 'Folder'},
+ 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': "orm['auth.User']"}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['filer.Folder']"}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+ },
+ 'filer.image': {
+ 'Meta': {'object_name': 'Image', '_ormbases': ['filer.File']},
+ '_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ '_width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'default_alt_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'default_caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'file_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['filer.File']", 'unique': 'True', 'primary_key': 'True'}),
+ 'must_always_publish_author_credit': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'must_always_publish_copyright': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'subject_location': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'blank': 'True'})
+ },
+ 'links.externallink': {
+ 'Meta': {'ordering': "['title']", 'object_name': 'ExternalLink'},
+ 'description': ('django.db.models.fields.TextField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'external_site': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'links'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['links.ExternalSite']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'kind': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'links'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['links.LinkType']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
+ 'url': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'links.externalsite': {
+ 'Meta': {'ordering': "['domain']", 'object_name': 'ExternalSite'},
+ 'domain': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['links.ExternalSite']"}),
+ 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+ 'site': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
+ 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+ },
+ 'links.linktype': {
+ 'Meta': {'object_name': 'LinkType'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'scheme': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
+ },
+ 'news_and_events.event': {
+ 'Meta': {'ordering': "['type', 'start_date', 'start_time']", 'object_name': 'Event'},
+ 'access_note': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'body': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+ 'building': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contacts_and_people.Building']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
+ 'child_list_heading': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'content': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'display_series_summary': ('django.db.models.fields.BooleanField', [], {'default': 'False'