Script that 'activates' a ebpub.db.models.Schema. This sets is_public=True, and sets pub_date to today for any older NewsItems of this schema.
Fixes the given schema's min_date, its news item pub_dates, and makes it public.
Sets pub_date equal to item_date for the earliest import of the given schema.
Sets the schema's min_date to the earliest item_date found in news items.
Use --help to get usage instructions.
Script that updates display_order for all ebpub.db.models.Location so that they are sorted alphabetically by name.
Optionally pass a LocationType.slug to only sort locations of that type.
Script that deletes all NewsItems of a given Schema (specified by slug).
To do a dry run and not actually delete anything, give the --dry-run option.
- ebpub.db.bin.delete_newsitems.delete(schema=None, do_delete=False)¶
Delete all NewsItems of a given Schema.
By default, does a dry run and just prints;
Prints out a SQL statement that can recreate one Schema row.
Arguments should be the slug of the Schema(s) you want.
Does not included related SchemaFields.
Script that finds NewsItems with null location fields, and attempts to geocode them based on their location_name.
Optionally provide a list of Schema.slug values to only geocode items of that schema.
Geocode NewsItems with null locations.
If schemas are provided, only geocode NewsItems with that particular schema slug(s).
Import neighborhoods from a shapefile. Try --help for usage instructions.
Assumes you have a LocationType with slug='neighborhoods'.
Script to import Locations from a shapefile. See Command Line: Importing Locations From Shapefiles
Add NewsItemLocations for all NewsItems that overlap with the new Location.
Script to populate Aggregates. Typically run without arguments. The --reset option will delete all aggregates first.
- ebpub.db.bin.update_aggregates.update_aggregates(schema_id_or_slug, dry_run=False, reset=False)¶
Updates all Aggregate* tables for the given schema_id/slug, deleting/updating the existing records if necessary.
If dry_run is True, then the records won't be updated -- only the SQL will be output.
If reset is True, then all aggregates for this schema will be deleted before updating.