Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
23 docs/install/base_install.rst
@@ -14,13 +14,27 @@ Creating a virtualenv
Create a "`virtualenv <http://pypi.python.org/pypi/virtualenv>`__" that will contain
the OpenBlock software and its python dependencies. (You probably do *not* want to
-do this as root or with sudo):
+do this as root or with sudo). With virtualenv 1.7 or later:
+
+.. code-block:: bash
+
+ $ virtualenv --system-site-packages openblock
+ $ cd openblock
+
+Or with virtualenv 1.6 or earlier:
.. code-block:: bash
$ virtualenv openblock
$ cd openblock
+.. admonition:: Why not --no-site-packages?
+
+ Experienced virtualenv users may wonder why we don't recommend using
+ the ``--no-site-packages`` option. See :ref:`no_site_packages` for
+ more info.
+
+
"Activate" your virtualenv - this makes sure that all python commands
will use your new virtual environment:
@@ -35,7 +49,7 @@ right directory.
We'll be using ``pip`` to install some software, so make sure it's
installed. Recent versions of virtualenv do this for you, but virtualenv
< 1.4.1 does not, so we need to make sure. We also recommend that you
-ensure that the latest versions of ``pip`` and ``distribute`` are installed:
+ensure that the latest version of ``distribute`` is installed:
.. code-block:: bash
@@ -90,8 +104,7 @@ Download the openblock software:
$ mkdir -p src/
$ git clone git://github.com/openplans/openblock.git src/openblock
-It takes a few more ``Pip`` commands to install for development, like so
-commands:
+It takes a few more ``Pip`` commands to install for development, like so:
.. code-block:: bash
@@ -102,6 +115,8 @@ commands:
$ pip install -e ebdata
$ pip install -r obadmin/requirements.txt
$ pip install -e obadmin
+ $ pip install -r obdemo/requirements.txt
+ $ pip install -e obdemo
If you encounter errors during package installation, please see :doc:`common_install_problems`.
View
37 docs/install/common_install_problems.rst
@@ -24,9 +24,29 @@ the Python package dependencies:
* You should have a recent version of distribute. Try ``easy_install --version``. If it says at least 'distribute 0.6.14', you're OK.
* Don't try to combine the ``pip install -r`` and ``pip install -e``
- commands. Doing so can result in the wrong version of a dependency.
+ commands in one line. Doing so can result in the wrong version of a dependency.
(This is a `pip bug <https://github.com/pypa/pip/issues/318>`_.)
+ Instead, run them as separate commands; first ``-r``, then ``-e``.
+.. _no_site_packages:
+
+Virtualenv: Global packages available or not?
+-----------------------------------------------
+
+Note that if you want to install GDAL or LXML the "easy way" as
+described below, you *must not* run virtualenv with the
+``--no-site-packages`` option, as that will prevent your virtualenv
+from being able to find the globally installed libraries.
+
+As of virtualenv 1.7, the default behavior has changed so you now
+**must** pass the ``--system-site-packages`` option
+in order to use globally installed packages.
+*The --no-site-packages option is now the default!*
+
+If you prefer the ``--no-site-packages`` way of using virtualenv,
+where it only has access to libraries that you explicitly install,
+then you must install GDAL and LXML from source, as described below in
+the "hard way" sections.
.. _lxml:
@@ -53,13 +73,15 @@ The slightly harder way
~~~~~~~~~~~~~~~~~~~~~~~
If your platform doesn't have a ready-made lxml package, or if you
-prefer to build your own, you'll need the libxml2 and libxslt
+prefer to build your own,
+or if you prefer :ref:`an isolated virtualenv <no_site_packages>`,
+you'll need the libxml2 and libxslt
development libraries, and then install lxml yourself. For example, on ubuntu
you can do:
.. code-block:: bash
- $ sudo apt-get install libxml2 libxml2-dev libxslt libxslt-dev
+ $ sudo apt-get install libxml2 libxml2-dev libxslt libxslt-dev build-essential python-dev
And once you have those, on any platform you can do:
@@ -87,13 +109,6 @@ this will work:
$ sudo apt-get install python-gdal
-(Note that if you want to take this approach, you *must not* run virtualenv
-with the ``--no-site-packages`` option, as that will prevent your
-virtualenv from being able to use this package. If you prefer the
-``--no-site-packages`` way of using virtualenv, you will have to
-install GDAL from source, as described below.)
-
-
GDAL the hard way
~~~~~~~~~~~~~~~~~~
@@ -108,7 +123,7 @@ this can be installed like:
.. code-block:: bash
- $ sudo apt-get install libgdal libgdal1-dev
+ $ sudo apt-get install libgdal1-1.6.0 libgdal1-dev build-essential python-dev
$ sudo ldconfig
Next, make sure you are in your openblock environment and it is activated:
View
3  ebdata/ebdata/scrapers/general/spreadsheet/retrieval.py
@@ -320,6 +320,9 @@ def save(self, old_record, list_record, detail_record):
return self.create_or_update(old_record, attributes,
**form.cleaned_data)
else:
+ self.logger.info("Skipping due to validation failures:")
+ for key, val in form.errors.items():
+ self.logger.info("%s: %s" % (key, val.as_text()))
raise SkipRecord(form.errors)
View
248 ebpub/ebpub/db/migrations/0029_auto__del_fields_schema__intro__grab_bag__grab_bag_headline.py
@@ -0,0 +1,248 @@
+# encoding: 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):
+
+ # Deleting field 'Schema.intro'
+ db.delete_column('db_schema', 'intro')
+
+ # Deleting field 'Schema.grab_bag_headline'
+ db.delete_column('db_schema', 'grab_bag_headline')
+
+ # Deleting field 'Schema.grab_bag'
+ db.delete_column('db_schema', 'grab_bag')
+
+
+ def backwards(self, orm):
+
+ # Adding field 'Schema.intro'
+ db.add_column('db_schema', 'intro', self.gf('django.db.models.fields.TextField')(default='', blank=True), keep_default=False)
+
+ # Adding field 'Schema.grab_bag_headline'
+ db.add_column('db_schema', 'grab_bag_headline', self.gf('django.db.models.fields.CharField')(default='', max_length=128, blank=True), keep_default=False)
+
+ # Adding field 'Schema.grab_bag'
+ db.add_column('db_schema', 'grab_bag', self.gf('django.db.models.fields.TextField')(default='', blank=True), keep_default=False)
+
+
+ models = {
+ 'db.aggregateall': {
+ 'Meta': {'object_name': 'AggregateAll'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'total': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'db.aggregateday': {
+ 'Meta': {'object_name': 'AggregateDay'},
+ 'date_part': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'total': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'db.aggregatefieldlookup': {
+ 'Meta': {'object_name': 'AggregateFieldLookup'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'lookup': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Lookup']"}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'schema_field': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SchemaField']"}),
+ 'total': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'db.aggregatelocation': {
+ 'Meta': {'object_name': 'AggregateLocation'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Location']"}),
+ 'location_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.LocationType']"}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'total': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'db.aggregatelocationday': {
+ 'Meta': {'object_name': 'AggregateLocationDay'},
+ 'date_part': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Location']"}),
+ 'location_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.LocationType']"}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'total': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'db.attribute': {
+ 'Meta': {'object_name': 'Attribute'},
+ 'bool01': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'bool02': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'bool03': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'bool04': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'bool05': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'date01': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'date02': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'date03': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'date04': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'date05': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'datetime01': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'datetime02': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'datetime03': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'datetime04': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'int01': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'int02': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'int03': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'int04': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'int05': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'int06': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'int07': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'news_item': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['db.NewsItem']", 'unique': 'True', 'primary_key': 'True'}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'text01': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'text02': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'time01': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'time02': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'varchar01': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True', 'blank': 'True'}),
+ 'varchar02': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True', 'blank': 'True'}),
+ 'varchar03': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True', 'blank': 'True'}),
+ 'varchar04': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True', 'blank': 'True'}),
+ 'varchar05': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True', 'blank': 'True'})
+ },
+ 'db.dataupdate': {
+ 'Meta': {'object_name': 'DataUpdate'},
+ 'got_error': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'num_added': ('django.db.models.fields.IntegerField', [], {}),
+ 'num_changed': ('django.db.models.fields.IntegerField', [], {}),
+ 'num_deleted': ('django.db.models.fields.IntegerField', [], {}),
+ 'num_skipped': ('django.db.models.fields.IntegerField', [], {}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'update_finish': ('django.db.models.fields.DateTimeField', [], {}),
+ 'update_start': ('django.db.models.fields.DateTimeField', [], {})
+ },
+ 'db.location': {
+ 'Meta': {'ordering': "('slug',)", 'unique_together': "(('slug', 'location_type'),)", 'object_name': 'Location'},
+ 'area': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'display_order': ('django.db.models.fields.SmallIntegerField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_mod_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'blank': 'True'}),
+ 'location': ('django.contrib.gis.db.models.fields.GeometryField', [], {'null': 'True'}),
+ 'location_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.LocationType']"}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'normalized_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
+ 'population': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '32', 'db_index': 'True'}),
+ 'source': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
+ 'user_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'db.locationsynonym': {
+ 'Meta': {'object_name': 'LocationSynonym'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Location']"}),
+ 'normalized_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
+ 'pretty_name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'db.locationtype': {
+ 'Meta': {'ordering': "('name',)", 'object_name': 'LocationType'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_browsable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_significant': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'plural_name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
+ 'scope': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'})
+ },
+ 'db.lookup': {
+ 'Meta': {'ordering': "('slug',)", 'unique_together': "(('slug', 'schema_field'), ('code', 'schema_field'), ('name', 'schema_field'))", 'object_name': 'Lookup'},
+ 'code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'schema_field': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SchemaField']"}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '32', 'db_index': 'True'})
+ },
+ 'db.newsitem': {
+ 'Meta': {'ordering': "('title',)", 'object_name': 'NewsItem'},
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'item_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'db_index': 'True', 'blank': 'True'}),
+ 'last_modification': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
+ 'location': ('django.contrib.gis.db.models.fields.GeometryField', [], {'null': 'True', 'blank': 'True'}),
+ 'location_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'location_object': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['db.Location']"}),
+ 'location_set': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['db.Location']", 'null': 'True', 'through': "orm['db.NewsItemLocation']", 'blank': 'True'}),
+ 'pub_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True', 'blank': 'True'}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'url': ('django.db.models.fields.TextField', [], {'blank': 'True'})
+ },
+ 'db.newsitemimage': {
+ 'Meta': {'unique_together': "(('news_item', 'image'),)", 'object_name': 'NewsItemImage'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '256'}),
+ 'news_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.NewsItem']"})
+ },
+ 'db.newsitemlocation': {
+ 'Meta': {'unique_together': "(('news_item', 'location'),)", 'object_name': 'NewsItemLocation'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Location']"}),
+ 'news_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.NewsItem']"})
+ },
+ 'db.schema': {
+ 'Meta': {'ordering': "('name',)", 'object_name': 'Schema'},
+ 'allow_charting': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'allow_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'allow_flagging': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'can_collapse': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'date_name': ('django.db.models.fields.CharField', [], {'default': "'Date'", 'max_length': '32'}),
+ 'date_name_plural': ('django.db.models.fields.CharField', [], {'default': "'Dates'", 'max_length': '32'}),
+ 'edit_window': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'blank': 'True'}),
+ 'has_newsitem_detail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'importance': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'indefinite_article': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
+ 'is_event': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'is_special_report': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_updated': ('django.db.models.fields.DateField', [], {}),
+ 'map_color': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'map_icon_url': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'min_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date(1970, 1, 1)'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'number_in_overview': ('django.db.models.fields.SmallIntegerField', [], {'default': '5'}),
+ 'plural_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'short_description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
+ 'short_source': ('django.db.models.fields.CharField', [], {'default': "'One-line description of where this information came from.'", 'max_length': '128', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}),
+ 'source': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
+ 'summary': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
+ 'update_frequency': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'blank': 'True'}),
+ 'uses_attributes_in_list': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
+ },
+ 'db.schemafield': {
+ 'Meta': {'ordering': "('pretty_name',)", 'unique_together': "(('schema', 'real_name'), ('schema', 'name'))", 'object_name': 'SchemaField'},
+ 'display': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'display_order': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_charted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_filter': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_lookup': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_searchable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'name': ('django.db.models.fields.SlugField', [], {'max_length': '32', 'db_index': 'True'}),
+ 'pretty_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'pretty_name_plural': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
+ 'schema': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Schema']"})
+ },
+ 'db.searchspecialcase': {
+ 'Meta': {'object_name': 'SearchSpecialCase'},
+ 'body': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'query': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}),
+ 'redirect_to': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'})
+ }
+ }
+
+ complete_apps = ['db']
View
2  ebpub/ebpub/db/models.py
@@ -1271,7 +1271,7 @@ class NewsItem(models.Model):
schema = models.ForeignKey(Schema, help_text=u'What kind of news is this and what extra fields does it have?')
title = models.CharField(max_length=255, help_text=u'the "headline"')
- description = models.TextField()
+ description = models.TextField(blank=True, default=u'')
url = models.TextField(
blank=True,
help_text="link to original source for this news")
View
13 ebpub/ebpub/media/scripts/openblockrichmap.js
@@ -273,7 +273,8 @@ var OpenblockMergeBBOX = OpenLayers.Class(OpenLayers.Strategy.BBOX, {
var existingFeatureIds = {};
var newFeatures = [];
- for (var i = 0; i < this.layer.features.length; i++) {
+ var i = 0;
+ for (i = 0; i < this.layer.features.length; i++) {
for (var j = 0; j < this.layer.features[i].cluster.length; j++) {
var feature = this.layer.features[i].cluster[j];
existingFeatureIds[feature.attributes.id] = true;
@@ -287,9 +288,10 @@ var OpenblockMergeBBOX = OpenLayers.Class(OpenLayers.Strategy.BBOX, {
if(features && features.length > 0) {
var remote = this.layer.projection;
var local = this.layer.map.getProjectionObject();
+ var len=features.length;
if(!local.equals(remote)) {
var geom;
- for(var i=0, len=features.length; i<len; ++i) {
+ for(i=0; i<len; ++i) {
geom = features[i].geometry;
if(geom) {
geom.transform(remote, local);
@@ -297,7 +299,7 @@ var OpenblockMergeBBOX = OpenLayers.Class(OpenLayers.Strategy.BBOX, {
}
}
- for (var i = 0; i < features.length; i++) {
+ for (i = 0; i < len; i++) {
var feature = features[i];
if (existingFeatureIds[feature.attributes.id] != true) {
newFeatures.push(feature);
@@ -620,13 +622,14 @@ OBMap.prototype._initBasicMap = function() {
};
OBMap.prototype._configureLayers = function() {
+ var i = 0;
if (typeof(this.options.locations) != 'undefined') {
- for (var i = 0; i < this.options.locations.length; i++) {
+ for (i = 0; i < this.options.locations.length; i++) {
this.loadLocationBorder(this.options.locations[i]);
}
}
if (typeof(this.options.layers) != 'undefined') {
- for (var i = 0; i < this.options.layers.length; i++) {
+ for (i = 0; i < this.options.layers.length; i++) {
this.loadFeatureLayer(this.options.layers[i]);
}
}
View
5 ebpub/ebpub/streets/migrations/0007_auto__add_field_place_place_type.py
@@ -7,7 +7,10 @@
class Migration(SchemaMigration):
def forwards(self, orm):
- default_place_type_id = orm['streets.PlaceType'].objects.get(slug='poi').id
+ if db.dry_run:
+ default_place_type_id = 1
+ else:
+ default_place_type_id = orm['streets.PlaceType'].objects.get(slug='poi').id
# Adding field 'Place.place_type'
db.add_column('streets_place', 'place_type', self.gf('django.db.models.fields.related.ForeignKey')(default=default_place_type_id, to=orm['streets.PlaceType']), keep_default=False)
View
8 obadmin/obadmin/admin/views.py
@@ -307,10 +307,14 @@ def import_items_from_spreadsheets(items_file, schema, mapping_file=None,
@csrf_protect
def import_newsitems(request):
- form = forms.ImportNewsForm(request.POST or None, request.FILES or None)
+ from ebdata.scrapers.general.spreadsheet.retrieval import get_default_unique_field_names
+ form = forms.ImportNewsForm(
+ request.POST or None, request.FILES or None,
+ initial={'unique_fields': get_default_unique_field_names()}
+ )
if form.save():
# TODO: Capture logging output and put that in message too?
- msg = u'Added %d, Updated %d, Skipped %d.' % (form.added, form.updated, form.skipped)
+ msg = u'%d added. %d updated. %d skipped or unchanged.' % (form.added, form.updated, form.skipped)
msg += u' See the server error log if you need more info.'
messages.add_message(request, messages.INFO, msg)
return HttpResponseRedirect('./')

No commit comments for this range

Something went wrong with that request. Please try again.