Cadasta / cadasta-qgis-plugin

[DEPRECATED] QGIS plugin to create, edit, upload and download Cadasta projects
GNU General Public License v3.0
4 stars 7 forks source link

Columns that have been joined should not upload to the Location End Point #220

Closed wonderchook closed 7 years ago

wonderchook commented 7 years ago

When a user joins the relationship and the parties table to locations then the relationship and parties information is submitted through the api to the location. This casues the following issue:

TypeError at /api/v1/organizations/chickenville/projects/kate-magical-test-file-2/spatial/ {'have_int': '4', 'name': 'blah blah blah', 'have_dec': '2.100000', 'fake-date': '2017-01-01', 'chickenville/kate-magical-test-file-2/relationships_rel_id': 'x4qc56zp8ybzj5gkxuejinku', 'chickenville/kate-magical-test-file-2/parties_name': 'two', 'chickenville/kate-magical-test-file-2/relationships_rel_name': 'CU', 'chickenville/kate-magical-test-file-2/relationships_party_id': 'awajdc97ktpve6gj6bqrjvwe', 'chickenville/kate-magical-test-file-2/parties_type': 'IN'} is not JSON serializable

dimasciput commented 7 years ago

@wonderchook I don't really understand this, could you upload your shp file?

cchristelis commented 7 years ago

@dimasciput and @wonderchook perhaps we could filter any fields wich have relationships_ or parties_, since these will be the default prefixes added to the columns?

cchristelis commented 7 years ago

another aproach would be to handle the exception, which seems to be on the object? or string? of the join coumn. (Will have to see more of the stack trace). That could possibly add the relationship for the next user, who downloads the project. But it would add useless data for the user who doesn't use QGIS...

SteadyCadence commented 7 years ago

@dimasciput

  1. Take any project that has party and location information and download it in QGIS.
  2. Then join (Properties < Join) the relationship table with location table.
  3. Edit the location table (you can only edit fields in the original file)
  4. Using the cadasta plugin, click "update project". The update project steps will want to submit the joined fields and you will get an error about invalid json.
dimasciput commented 7 years ago

Hi @wonderchook,

This PR https://github.com/Cadasta/cadasta-qgis-plugin/pull/233, will only fix this issue.

Can we not join the table for this? Because this plugin is not built with joined table in mind. This will introduces a lot other issues. Even the first mockup doesn't have split table.

wonderchook commented 7 years ago

@dimasciput people are going to have to join the tables to do analysis. They don't need to upload the joined tables.

SteadyCadence commented 7 years ago

@dimasciput do you need anything from me? Do you understand the issue?

dimasciput commented 7 years ago

Hi @SteadyCadence , I think already fixed this issue with this PR https://github.com/Cadasta/cadasta-qgis-plugin/pull/233

dimasciput commented 7 years ago

@SteadyCadence have you tested this?