GithubHelp home page GithubHelp logo

wd5 / django-import-excel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ostrovok-tech/django-import-excel

0.0 2.0 0.0 72 KB

Django App for import excel

Home Page: http://satels.blogspot.com/2011/12/django-excel.html

django-import-excel's Introduction

django-import-excel

django-import-excel - App for load data from excel (a excel file load on django form)

Settings

settings.py:

INSTALLED_APPS = [
     ...
     'import_excel',
     ...
]

Example

Model:

class Book(models.Model):
    name = models.CharField(max_length=255)
    author = models.CharField(max_length=255)

Excel File:

name | author
Tom Sawyer | Mark Twain
The Sands of Mars | Arthur C. Clarke

Form:

from import_excel.forms import ImportExcelForm
class BookImportForm(ImportExcelForm):
    @transaction.autocommit
    def update_callback(self, request, converted_items):
        for book_item in converted_items[:1]:
            name = book_item[0]
            author = book_item[1]
            Book.objects.create(name=name, author=author)

urls.py:

urlpatterns = patterns('',
    url(r'^/books/import-from-excel/$', permission_required('books.add_book')(import_excel), {
        'FormClass': BookImportForm, 'next_url': '/books/', 'with_good': True, 'template_name': 'import_excel/import_excel.html',
    }, name='book-import-excel'),
),

django-import-excel's People

Contributors

satels avatar

Watchers

James Cloos avatar wd5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.