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
[WIP] 2750 add docs and examples for idatasetform and igroupform #295
[WIP] 2750 add docs and examples for idatasetform and igroupform #295
Conversation
The form_to_db_schema() methods of IGroupForm plugins were not being called if those plugins inherited from DefaultGroupForm. Refactor it in the same way as DefaultDatasetForm's form_to_db_schema_options() method was recently refactored. Make it call self.form_to_db_schema so that the form_to_db_schema() methods of IGroupForm extensions get called. Also make it call new form_to_db_schema_api_create() and form_to_db_schema_api_update() methods which could potentially be overridden by extensions also.
Fix group controller calling form_to_db_schema() from IGroupForm plugin when it should be using db_to_form_schema()
Make group_create() and group_update() call the check_data_dict() methods of IGroupForm plugins, like package_create() and package_update() do with IDatasetForm plugins.
…examples-for-idatasetform-and-igroupform
…examples-for-idatasetform-and-igroupform
…examples-for-idatasetform-and-igroupform
" ... {} ... ".format(foo) is not supported in Python 2.6, you have to use {0}.
…examples-for-idatasetform-and-igroupform Conflicts: setup.py
…examples-for-idatasetform-and-igroupform
…examples-for-idatasetform-and-igroupform
Update the ckanext/example_idatasetform templates for CKAN 2.0.
Implement do_to_form_schema_options() and form_to_db_schema_options() so that ckanext-exampleidatasetform's db_to_form_schema() and form_to_db_schema() methods actually get called. This is a temporary fix, this needs to be sorted out in CKAN core.
Skype with @kindly about this, some possibilities to investigate for why the tests aren't working:
|
…examples-for-idatasetform-and-igroupform
Extensions no longer need to pass model and session when calling action functions.
Not the best or most thorough test case ever but it's something, and it passes.
…examples-for-idatasetform-and-igroupform
That's Currently you need to put |
It was causing problems, is not supposed to be overridden.
Is not supposed to be overridden, not part of the IDatasetForm interface.
It had the wrong number of params, this was probably causing some crashes and test fails.
…examples-for-idatasetform-and-igroupform
…orm' of github.com:okfn/ckan into 2750-add-docs-and-examples-for-idatasetform-and-igroupform
@wardi You're right, something's broken, I'll look into it |
I think this is why I took the approach I did with these: It makes sense that the schema for creation/editing is a little different, and in each case we just need to modify the schema by adding some fields. It might be better for the idatasetform to have a method that is just called to update a schema instead creating it from scratch. |
…examples-for-idatasetform-and-igroupform Conflicts: ckan/logic/schema.py
@wardi |
…examples-for-idatasetform-and-igroupform
Instead of calling parent class methods directly
I've updated example_idatasetform for CKAN 2.0, but not example_igroupform yet.
example_idatasetform is still not working because of bugs in CKAN that break IDatasetFormexample_idatasetform
on this branch is updated for CKAN 2.0 and working, but only tested manually, haven't got the unit tests running yet.example_igroupform
is not updated for CKAN 2.0 yet.Also I cannot get it to load the plugin when running the tests.