This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django-zotero is a django app that provides a generic formset to tag any django object with Zotero metadata. Tagged object are easily exportable to Zotero in one click.

Installation

First of all, it is needed to have pip installed on your system. It is strongly recommended to install virtualenv and virtualenvwrapper to take the most advantage of pip.

To install pip, go to http://www.pip-installer.org/en/latest/installing.html

To install virtualenv, go to https://pypi.python.org/pypi/virtualenv

To install virtualenvwrapper, go to http://virtualenvwrapper.readthedocs.org/en/latest/install.html#basic-installation

Now install django-zotero:

$ pip install django-zotero

Usage

To use django-zotero, follow the next steps:

  1. Django settings: add the app name to INSTALLED_APPS in settings.py:

    INSTALLED_APPS = (
        #...,
        'zotero',
    )
    
  2. Administration side: add the following code to admin.py:

    1. Import the class TagInlineAdmin [1]:

      from zotero.admin import TagInlineAdmin
      
    2. For each model you wish to tag, add to its admin class:

      inlines = (
          #...,
          TagInlineAdmin,
      )
      
  3. User side: add the following code:

    1. In views.py:

      1. Import the function get_tag_formset [2]:

        from zotero.forms import get_tag_formset
        
      2. In the view that manages the tagged object, instanciate the formset and save it:

        tag_formset = get_tag_formset(
            obj=form.instance,
            data=request.POST,
            show_labels=False,
            labels={
                'item_type': 'Document type',
                #...,
            }
        )
        #...
        tag_formset.save()
        
    2. In the template that manages the object:

      1. Import the template tag zotero_inline_tags [3]:

        {% load zotero_inline_tags from zotero_inline_extras %}
        
      2. Render the formset:

        {% zotero_inline_tags formset %}
        
    3. In the template that renders the object:

      1. Import the template tag zotero_tags [4]:

        {% load zotero_tags from zotero_tags_extras %}
        
      2. Render Zotero metadata:

        {% zotero_tags
            object=document
            vocabulary="dc"
            output_method="meta" %}
        
[1]TagInlineAdmin is an inline class ready to be added as inline of other admin class.
[2]

get_tag_formset is a function that gets the formset with Zotero tags for an object. It is based on a generic formset factory and takes four arguments:

  1. obj: object to tag
  2. data: data to instanciate the content of the formset
  3. show_labels: if true, show the labels as headers on the top of the formset; if false, show the labels as placeholders
  4. labels: set alternative labels - default labels are ‘item_type’, ‘field’ and ‘value’
[3]zotero_inline_tags is a template tag that renders a formset. It takes one argument: the formset it renders.
[4]

zotero_tags is a template tag that renders the HTML code of Zotero metadata. It takes three arguments:

  1. object: tagged object
  2. vocabulary: the vocabulary to code the metadata - currently it works with Dublin Core (“dc”)
  3. output_method: the method to code the metadata - currently it works HTML <meta> tags (“meta”)
Release History

Release History

0.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-zotero-0.4.tar.gz (136.3 kB) Copy SHA256 Checksum SHA256 Source Jan 7, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting