Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

num_followers and package_count not in default_group_schema #1434

Closed
davidread opened this issue Jan 14, 2014 · 2 comments · Fixed by #1627
Closed

num_followers and package_count not in default_group_schema #1434

davidread opened this issue Jan 14, 2014 · 2 comments · Fixed by #1627
Assignees

Comments

@davidread
Copy link
Contributor

When creating a custom group schema, I start from default_group_schema, but it doesn't work on its own - I have to add in the package_count and num_followers fields to it. They are used by the templates.

snippets/organization.html requires the organization.package_count and organization.num_followers. validation is not run on group_show - why not? Shouldn't it run default_group_schema?

Here's how I got my IGroupForm schema to work:

    def db_to_form_schema(self):
        from ckan.logic.schema import default_group_schema
        from ckan.lib.navl.validators import ignore_missing
        schema = default_group_schema()
        schema['num_followers'] = [ignore_missing]
        schema['package_count'] = [ignore_missing]
        return schema
@ghost ghost assigned wardi Jan 21, 2014
@wardi
Copy link
Contributor

wardi commented Jan 22, 2014

yes, it looks like these should be in default_group_schema https://github.com/okfn/ckan/blob/master/ckan/logic/schema.py#L263

[edit] which of course is what your title says..

@wardi
Copy link
Contributor

wardi commented Jan 22, 2014

I'm also for always running validation, even when no schema is passed in to the context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants