-
Notifications
You must be signed in to change notification settings - Fork 26
Misc. Django scripts
Dolsy Smith edited this page May 14, 2023
·
2 revisions
data_to_export = []
for c in collections_harvests_past_year:
user = c.credential.user
last_harvest = c.last_harvest()
coll_dict = {'name': c.name,
'description': c.description,
'is_on': c.is_on,
'username': user.username,
'email': user.email,
'type': c.harvest_type,
'id': c.id,
'collection_id': c.collection_id}
coll_dict.update(c.stats())
if last_harvest:
coll_dict['last_harvest_requested'] = last_harvest.date_requested.isoformat()
if last_harvest.date_ended:
coll_dict['last_harvest_concluded'] = last_harvest.date_ended.isoformat()
data_to_export.append(coll_dict)