You need to implement a django model that can convert an excel file to JSON. First a simple popup div with a HTML-form is needed to select the file to be uploaded. This form should use a specific django template. This needs to be implemented by you. Your method should save the excel file to a specific local storage path. This path should be dynamically changeable. So a setter function of the local storage path is needed. If the setter function is not used a default path is used instead. Save the excel file and convert it to JSON.
The excel file can contain different working sheets. Depending on a comma separated list of sheet numbers (1,3,4) your conversion should look like
{ status : "success", data : [sheet 1 : [], sheet 3 : [], sheet 4 : []]} If no list with sheet numbers was passed the JSON conversion should convert all sheets. E.g. if we have 5 sheets: { status : "success", data : [sheet 0 : [], sheet 1 : [], sheet 2 : [], sheet 3 : [], sheet 4 : []]}
Each sheet JSON-structure should look like this:
sheet 0 :
[
[cellValue 0/0, cellValue 0/1 ? cellValue 0/n], ?
[cellValue m/0, cellValue m/1 ? cellValue m/n]
]
Empty rows and empty columns that does not belong to the data table should be skipped and each row array object of the same sheet should consist of the same length.
Send the JSON-file back to the client. Close the popup div if everything went well (otherwise show the error message) and append the content of the file into a div in order to see the result. That's all.
A sample excel file can be found here: [login to view URL] Please consider the copyright of this document (copyright by Information und Technik NRW, D?sseldorf, 2010, see page "Impressum").
## Deliverables
Further requirements:
- Please comment your code.
- Support of Python 2.6
- Support of Django 1.2
- Support UTF8 encoding
- Performance optimization is needed if a excel file with 1000 rows can not be converted to the JSON-file during 0-1.5 seconds
What the whole project is about:
-------------------------------------------------------
Imagine a map, with real estates. Our aim is to filter these real estates depending on environmental information. E.g. if the user wants to live next to a specific POI (let?s say a supermarket) the system hides all real estates that don't match that criteria and lie within his preferred distance.