Django SuperTagging v0.4.5 documentation
Contents
Here is a list of all the SuperTagging settings and there uses.
Tells the default process type for OpenCalais to process the data.
There are 4 options that can be supplied. Default is TEXT/RAW
- TEXT/RAW
- TEXT/HTML
- TEXT/HTMLRAW
- TEXT/XML
Weather or not supertagging is enabled. Will not process any objects if False.
Your OpenCalais API Key
If True, will set up post_save and post_delete signals to process the data.
Weather to use the Queue system. When a object is saved, it will be saved to a queue for later processing. A management command is included for you to process the queue.
This settings is a dictionary that specifies all the models, fields and options.
Example of specifying the models
SUPERTAGGING_MODULES = {
'stories.story': {},
}
SUPERTAGGING_MODULES = {
'stories.story': {},
'media.image': {},
'blog.entry': {},
}
The values of the models is a dictionary, where the fields and options are specified.
Possible values:
fields - List of dictionaries that specify field names and its options
- match_kwargs - A dictionary of extra query parameters to check when processing instances of the model
- Performs an extra .get(**kwargs) on the instance to ensure it validates against the extra kwargs. (Optional)
- date_field - The name of the field to retrieve the instance date.
If this is not specified, supertagging will try to retrieve the data from the instance _meta.get_latest_by or _meta.ordering. This field is saved into SuperTaggedItem for later sorting by the items date. (Optional)
Here is and example for fields, date_field and match_kwargs
SUPERTAGGING_MODULES = {
'stories.story': {
'fields': [{'name': 'body'},],
'match_kwargs': {'status__in': [1,2,3,],
'published_date__isnull': False},
'date_field': 'published_date'
}
}
Fields can be any number of fields in an instance as well.
SUPERTAGGING_MODULES = {
'stories.story': {
'fields': [{'name': 'body',
'name': 'tease',
'name': 'kicker'},],
}
}
Here is a list of the different options that can be specified for each field
name - The name of the field (Required)
tagging the data, possible values are “TEXT/RAW”, “TEXT/HTML” and “TEXT/XML”, Default is “TEXT/RAW” (Optional)
not. Default is False (Optional)
A complete example:
SUPERTAGGING_MODULES = {
'stories.story': {
'fields': [{'name': 'body',
'process_type': 'TEXT/HTML',
'markup': True},
{'name': 'tease'},
{'name': 'kicker',
'markup': True}],
'match_kwargs': {'status__in': [1,2,3,],
'published_date__isnull': False},
'date_field': 'published_date'
},
'media.image': {
'fields': [{'name': 'caption',
'process_type': 'TEXT/HTML',
'markup': True}],
'date_field': 'creation_date'
}
}
These next two settings are options for open calais.
View Input Parameters on OpenCalais.com for more information.
View Input Parameters on OpenCalais.com for more information.
Weather or not to include the tag relations (Events/Facts) returned by OpenCalais
Weather or not to include the topics returned by OpenCalais. These will simply be added as tags, but will not include tag details such as relevance.
If True, an additional attribute will be avilable in a model’s instance for easy query related access to SuperTagging.
If True, errors will fail loudly in order to debug the code.
Tag types as strings to exclude from being added. These tags should be all the “Entities” listed on the following link.
Same as above but these are the relations and are shown on the following link as “Events and Facts”
When True, and then a substitute is specified in SuperTag all associated SuperTaggedItem and SuperTagRelation will be updated with the new tag.
If True, supertagging will try resolve the Calais ID to a tag name.
If True, will only process objects that have not been tagged before.
Integer between 0 and 1000, will only save tags that have a higher relevance that this setting. Topics do not use this value since they return no relevance.
Integer between 0 and 1000, tells supertagging the min relevance to use when marking up the content.
Weather or not to use Freebase to disambiguate the tags.
For better disambiguation, use this setting to map calais types to freebase types.
If the display fields are enabled, you can have freebase retrieve the description for the tags.
The first part of the url where to retrieve the descriptions.
Weather or not to markup is enabled.
If markup is enabled, supertagging will add a field to the instance with the marked up content, this setting specifies the prefix. Default is ‘tagged’
IE: if ‘body’ field is marked for tagging, by default a field called ‘tagged_body’ will be available in the instance that contains the content with marked up content.
List of strings of values to exclude from being marked up, for example, OpenCalais returns ‘his’, ‘her’, ‘him’ etc. in reference to a tag.
Weahter or not to include 3 extra fields for display purposes.
Default file storage used for the icon display field
A dict of mapped content type ids to names, used for the views
{34, 'stories',
83, 'images'}
Where the key is the content type id and the value is the string used in the url
/supertagging/tag/barack_obama/stories/
/supertagging/tag/barack_obama/images/
This was done in order to make readable urls.