Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Multiform #39

Closed
wants to merge 9 commits into from
Closed

Multiform #39

wants to merge 9 commits into from

Conversation

bitner
Copy link
Collaborator

@bitner bitner commented Sep 13, 2016

Change to extend the api to handle multi file uploads.

@jj0hns0n
Copy link
Contributor

@bitner looks like the GS_VERSION=master build just timed out. Can you rebase with master so it can kick the build again.

@sarasafavi
Copy link
Collaborator

sarasafavi commented Sep 14, 2016

@bitner FYI this appears to break .zip file handling in the current UI:

I can successfully use the current interface to upload individual files (e.g., .gpkg, .tif, .geojson) but a .zip containing a single shapefile no longer works. I get Inspector could not read file or file is empty for each file within the zip archive, e.g.,:

image

@jj0hns0n
Copy link
Contributor

I am seeing the same behavior.

return False


def validate_inspector_can_read(filename):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow your intent on this @bitner, and I'm thinking this is related to the zip file issue -- why are we shadowing models.validate_inspector_can_read() here?

@bitner
Copy link
Collaborator Author

bitner commented Sep 15, 2016

We do that in the form clean so that we can look in either the upload or a
zip and only save the file to disk if we actually have the necessary files
there. A lot of this is due to file types (ie shapefile) that have multiple
files that need to be in the same directory in order to validate where the
models save moves each file to a temp directory to validate.

On Wed, Sep 14, 2016 at 7:01 PM, Sara Safavi notifications@github.com
wrote:

@sarasafavi commented on this pull request.

In osgeo_importer/validators.py
#39 (review)
:

  •    extension = extension.lstrip('.').lower()
    
  •    if extension == 'shp':
    
  •        shp.append(base)
    
  •    elif extension == 'prj':
    
  •        prj.append(base)
    
  •    elif extension == 'dbf':
    
  •        dbf.append(base)
    
  •    elif extension == 'shx':
    
  •        shx.append(base)
    
  • if set(shp) == set(prj) == set(dbf) == set(shx):
  •    return True
    
  • else:
  •    return False
    
    +def validate_inspector_can_read(filename):

I'm not sure I follow your intent on this @bitner
https://github.com/bitner, and I'm thinking this is related to the zip
file issue -- why are we shadowing models.validate_inspector_can_read()
here?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#39 (review),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKD3PYFZQSfu2ZmO6nqhQz6OnGMtSaiks5qqIrwgaJpZM4J8Jqd
.


David William Bitner
dbSpatial LLC
612-424-9932

@bitner
Copy link
Collaborator Author

bitner commented Sep 15, 2016

Hmmm....The multi tests use a zipfile, not sure why it's not working
through the ui. I can look at this later this afternoon or tomorrow.

On Wed, Sep 14, 2016 at 6:03 PM, Sara Safavi notifications@github.com
wrote:

@bitner https://github.com/bitner FYI this appears to break .zip file
handling in the current UI:

I can successfully use the current interface to upload individual files
(e.g., .gpkg, .tif, .geojson) but a .zip containing a shapefile no longer
works. I get Inspector could not read file or file is empty for each file
within the zip archive, e.g.,:

[image: image]
https://cloud.githubusercontent.com/assets/1209376/18533008/88d1c1a4-7aa5-11e6-9400-bfd18746f0ef.png


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#39 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKD3AN21VCFTO888mrW0gkLCj3AhxVCks5qqH1SgaJpZM4J8Jqd
.


David William Bitner
dbSpatial LLC
612-424-9932

@bitner
Copy link
Collaborator Author

bitner commented Sep 28, 2016

I'm going to close this pull request as @sarasafavi and @harts-boundless have wrapped and extended this into https://github.com/boundlessgeo/django-osgeo-importer/ master. It would make more sense to merge from that fork rather than this branch now as it contains all the UI additions as well.

@bitner bitner closed this Sep 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants