Skip to content

Instantly share code, notes, and snippets.

@dwcaraway
Created November 15, 2013 11:24
Show Gist options
  • Save dwcaraway/7482895 to your computer and use it in GitHub Desktop.
Save dwcaraway/7482895 to your computer and use it in GitHub Desktop.
def default_create_package_schema():
schema = {
'__before': [duplicate_extras_key, ignore],
'id': [empty],
'revision_id': [ignore],
'name': [not_empty, unicode, name_validator, package_name_validator],
'title': [if_empty_same_as("name"), unicode],
'author': [ignore_missing, unicode],
'author_email': [ignore_missing, unicode],
'maintainer': [ignore_missing, unicode],
'maintainer_email': [ignore_missing, unicode],
'license_id': [ignore_missing, unicode],
'notes': [ignore_missing, unicode],
'url': [ignore_missing, unicode],#, URL(add_http=False)],
'version': [ignore_missing, unicode, package_version_validator],
'state': [ignore_not_package_admin, ignore_missing],
'type': [ignore_missing, unicode],
'owner_org': [owner_org_validator, unicode],
'log_message': [ignore_missing, unicode, no_http],
'private': [ignore_missing, boolean_validator,
datasets_with_no_organization_cannot_be_private],
'__extras': [ignore],
'__junk': [empty],
'resources': default_resource_schema(),
'tags': default_tags_schema(),
'tag_string': [ignore_missing, tag_string_convert],
'extras': default_extras_schema(),
'save': [ignore],
'return_to': [ignore],
'relationships_as_object': default_relationship_schema(),
'relationships_as_subject': default_relationship_schema(),
'groups': {
'id': [ignore_missing, unicode],
'name': [ignore_missing, unicode],
'title': [ignore_missing, unicode],
'__extras': [ignore],
}
}
return schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment