Skip to content

Instantly share code, notes, and snippets.

@adamcheasley
Forked from mattss/contentaudit.py
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcheasley/e92bae2416860a61b3f7 to your computer and use it in GitHub Desktop.
Save adamcheasley/e92bae2416860a61b3f7 to your computer and use it in GitHub Desktop.
# quick and dirty skin script to audit a site's content
# stucture is {portal_type: {state: count}}
brains = context.portal_catalog.searchResults()
types = {}
for brain in brains:
ctype = brain['portal_type']
state = brain['review_state']
state_counts = types.setdefault(ctype, {})
count = state_counts.setdefault(state, 0)
state_counts[state] = count + 1
print types
return printed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment