• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created almost 12 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An import tool easy enough your users could use it

django-simple-import

An easy to use import tool for Django. django-simple-import aims to keep track of logs and user preferences in the database.

Project is now stable and in maintenance only mode. If you'd like to add features please fork or take over ownership.

Changelog

2.1

  • Add support for Django 2.2 and 3.0
  • Move to gitlab and gitlab CI for freedom and consistency with other Burke Software maintained projects

2.0

2.0 adds support for Django 1.9 and 1.10. Support for 1.8 and under is dropped. Support for Python 2 is dropped. Removed support for django-custom-field Use 1.x for older environments.

1.17

The most apparent changes are 1.7 compatibility and migration to Django's atomic transactions. Please report any issues. I test against mysql innodb, postgres, and sqlite.

Features

  • Supports csv, xls, xlsx, and ods import file
  • Save user matches of column headers to fields
  • Guess matches
  • Create, update, or both
  • Allow programmers to define special import methods for custom handling
  • Set related objects by any unique field
  • Simulate imports before commiting to database
  • Undo (create only) imports
  • Security checks if user has correct permissions (partially implemented)

Install

  1. pip install django-simple-import[ods,xls,xlsx] for full install or specify which formats you need to support. CSV is supported out of box.
  2. Add 'simple_import' to INSTALLED APPS
  3. Add simple_import to urls.py like url(r'^simple_import/', include('simple_import.urls')),
  4. migrate

Optional Settings

Define allowed methods to be "imported". Example:

class Foo(models.Model):
    ...
    def set_bar(self, value):
        self.bar = value
    simple_import_methods = ('set_bar',)

settings.py

SIMPLE_IMPORT_LAZY_CHOICES: Default True. If enabled simple_import will look up choices when importing. Example:

choices  = ['M', 'Monday']

If the spreadsheet value is "Monday" it will set the database value to "M."

SIMPLE_IMPORT_LAZY_CHOICES_STRIP: Default False. If enabled, simple_import will trip leading/trailing whitespace from the cell's value before checking for a match. Only relevant when SIMPLE_IMPORT_LAZY_CHOICES is also enabled.

If you need any help, we do consulting and custom development. Just email us at david at burkesoftware.com.

Usage

Go to /simple_import/start_import/ or use the admin interface.

The screenshots have a django-grappelli like theme. The base templates have no style and are very basic. See an example of customization here. It is often sufficient to simply override simple_import/templates/base.html.

There is also a log of import records. Check out /admin/simple_import/.

Odd Things

Added a special set password property on auth.User to set password. This sets the password instead of just saving a hash.

User has some required fields that...aren't really required. Hardcoded to let them pass.

Security

I'm working on the assumption staff users are trusted. Only users with change permission to a field will see it as an option. I have not spent much time looking for ways users could manipulate URLs to run unauthorized imports. Feel free to contribute changes. All import views do require admin "is staff" permission.

Testing

If you have docker-compose and Docker installed, then just running docker-compose run --rm app ./manage.py test will do everything you need to test the packages.

Otherwise look at the .travis.yml file for test dependencies.

More Repositories

1

django-report-builder

This is a github mirror for django-report-builder which is hosted on Gitlab. Django Report Builder is a GUI for Django ORM. Build custom queries and display results. Targets sys admins and capable end users who might not be able to program.
Python
750
star
2

schooldriver

A school information system made in django. Relies heavily on the django admin interface and includes many pluggable apps.
Python
185
star
3

django-mass-edit

Make bulk changes in the Django admin interface
Python
139
star
4

django-responsive-dashboard

A generic and easy dashboard for Django applications.
Python
47
star
5

django-content-edit

A very simple way to let users edit content on the front end of a website when you don't quite need a full CMS.
HTML
24
star
6

GlitchTip

Mirror of https://gitlab.com/glitchtip/glitchtip
Dockerfile
12
star
7

django-admin-export

Generic export to xls action for Django admin interface
Python
11
star
8

django-report-utils

Common functions used for reporting needs. Used by django-report-builder and django-report-scaffold.
Python
10
star
9

django-auth-gapps

A simple way to authenticate to Google Apps using the provisioning API. If you want oath to allow any Google user to login look elsewhere. This is more like a Google Apps version of django-auth-ldap. It supports Group mappings as well.
Python
10
star
10

django-report-scaffold

Create streamlined and flexible reporting tools for your end users. Report scaffold is not a drop in application but a framework for creating reporting tools. Think of it like django admin.
Python
5
star
11

django-ldap-groups

A fork of django-ldap-groups
Python
3
star
12

BSC-website

Company website
Python
2
star
13

simple-asymmetric-python

github mirror - use https://gitlab.com/burke-software/simple-asymmetric-python
Python
2
star
14

handsontable-gradebook

An gradebook made with angular and handsontable.
JavaScript
1
star
15

django-floppy-gumby

Gumby Framework forms for Django using floppy forms. A floppy and gumby project.
Python
1
star