[ckan-changes] commit/ckanext-harvest: amercader: Change date definitions in Harvest Objects. reference_date -> metadata_modified_date, created -> gathered
Bitbucket
commits-noreply at bitbucket.org
Wed May 11 16:08:09 UTC 2011
1 new changeset in ckanext-harvest:
http://bitbucket.org/okfn/ckanext-harvest/changeset/5ae291795290/
changeset: r91:5ae291795290
user: amercader
date: 2011-05-11 18:07:05
summary: Change date definitions in Harvest Objects. reference_date -> metadata_modified_date, created -> gathered
affected #: 3 files (43 bytes)
--- a/ckanext/harvest/harvesters.py Tue May 10 17:11:12 2011 +0100
+++ b/ckanext/harvest/harvesters.py Wed May 11 17:07:05 2011 +0100
@@ -148,8 +148,8 @@
# http://ec2-46-51-149-132.eu-west-1.compute.amazonaws.com:8081/api/2/rest/package/77d93608-3a3e-42e5-baab-3521afb504f1
package_dict = json.loads(harvest_object.content)
- # Save reference date in Harvest Object
- harvest_object.reference_date = package_dict['metadata_modified']
+ # Save metadata modified date in Harvest Object
+ harvest_object.metadata_modified_date = package_dict['metadata_modified']
harvest_object.save()
## change default schema
--- a/ckanext/harvest/lib/__init__.py Tue May 10 17:11:12 2011 +0100
+++ b/ckanext/harvest/lib/__init__.py Wed May 11 17:07:05 2011 +0100
@@ -326,15 +326,15 @@
.filter(HarvestJob.source==source) \
.filter(HarvestObject.package!=None) \
.order_by(HarvestObject.guid) \
- .order_by(HarvestObject.reference_date.desc()) \
- .order_by(HarvestObject.created.desc()) \
+ .order_by(HarvestObject.metadata_modified_date.desc()) \
+ .order_by(HarvestObject.gathered.desc()) \
.all()
else:
last_objects = Session.query(HarvestObject) \
.filter(HarvestObject.package!=None) \
.order_by(HarvestObject.guid) \
- .order_by(HarvestObject.reference_date.desc()) \
- .order_by(HarvestObject.created.desc()) \
+ .order_by(HarvestObject.metadata_modified_date.desc()) \
+ .order_by(HarvestObject.gathered.desc()) \
.all()
--- a/ckanext/harvest/model/__init__.py Tue May 10 17:11:12 2011 +0100
+++ b/ckanext/harvest/model/__init__.py Wed May 11 17:07:05 2011 +0100
@@ -119,13 +119,13 @@
harvest_object_table = Table('harvest_object', metadata,
Column('id', types.UnicodeText, primary_key=True, default=make_uuid),
Column('guid', types.UnicodeText, default=''),
- Column('reference_date', DateTime),
- Column('created', DateTime, default=datetime.datetime.utcnow),
+ Column('gathered', DateTime, default=datetime.datetime.utcnow),
+ Column('fetch_started', DateTime),
Column('content', types.UnicodeText, nullable=True),
+ Column('fetch_finished', DateTime),
+ Column('metadata_modified_date', DateTime),
+ Column('retry_times',types.Integer),
Column('harvest_job_id', types.UnicodeText, ForeignKey('harvest_job.id')),
- Column('fetch_started', DateTime),
- Column('fetch_finished', DateTime),
- Column('retry_times',types.Integer),
Column('package_id', types.UnicodeText, ForeignKey('package.id'), nullable=True),
)
# New table
Repository URL: https://bitbucket.org/okfn/ckanext-harvest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list