Coder Social home page Coder Social logo

skyl / django-files Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 222 KB

Tag simple file object with metadata to you other models. Now you can "see files for object" and "add a file to object". You might want to checkout django-attachments.

Home Page: http://skyl.org

License: MIT License

Python 35.55% JavaScript 64.45%

django-files's Introduction

django-files

An app for tagging arbitrary models with "files". A file is a simple model with a filefield, title, description, owner, content-object.

The idea is to have templatetags for tagging objects with (google gears drag and drop?)

Likewise, an overview of files for various model_instances will be obtainable.

Requirements

This app is being built for pinax-0.7+. Your mileage may vary out of the box in other environments. For quick integration you will need a current copy django-uni_form, for instance.

Install

  • Check out the code onto your path as files:

    git clone git://github.com/skyl/django-files.git files
  • Add 'files' to INSTALLED_APPS
  • add (r'^files/', include('files.urls')), to your urlpatterns
  • syncdb

For Pinax you can take the additional steps, add to the right_tabs block in site_base.html:

<li id="tab_files"><a href="{% url files_all %}">{% trans "Files" %}</a></li>

In site_tabs.css you can add rules for body.files #tab_files a and body.files #tab_files.

Pinax Usage

In the template with the object(s) you want to tag add:

{% load files_tags %}

Where you would like the link to add an file to a model instance:

{% file_link_add_to myModelInstance 'css_id' %}

To make this link a jQuery dialog widget, in extra_body:

<script type="text/javascript" src="{{MEDIA_URL}}files/js/jquery-ui.js"></script>
{% add_file_to myModelinstance 'css_id' %}

Note that you can choose 'css_id' for these tags but they must match.

Add css for the widget to extra_head:

{% include 'files/widgetCSS.html' %}

To add a link to all of the files for a model instance:

{% link_to_files_for myModelInstance 'css_class' %}

django-files's People

Contributors

skyl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

geonodechile

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.