Details of Django server working

The details of the architecture of how the server is designed.

Blueprint information

Status:
Not started
Approver:
None
Priority:
High
Drafter:
Manish Sinha (मनीष सिन्हा)
Direction:
Needs approval
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Event Types
==============

The server logs two kinds of events
* Generic Events
* Specific events

Generic Events
---------------------
The generic events are the events which we do not categorize. They look nearly the same as that we have in Zeitgeist.
The generic events have the fields
fields = ('uid', 'timestamp', 'origin', 'interpretation', 'manifestation', 'actor',
            ('subject', ('interpretation', 'manifestation', 'origin', 'mimetype', 'text')))

Specific Events
---------------------
Specific events are built on top of generic events. They are generic events with additional metadata.
Example of specific events are Music, Video, Application etc.
The Music event looks like
fields = (
        'title', 'artist', 'album', 'year', 'comment', 'track', 'genre',
        ('event', ('uid', 'timestamp', 'origin', 'interpretation', 'manifestation', 'actor',
            ('subject', ( 'interpretation', 'manifestation', 'origin', 'mimetype', 'text')))))
As it can be seen Music event is Generic event+ some additional metadata which makes sense only for that specific event type

Technology
============
Affinity uses Django with django-piston for RESTful API
It has CSRF check disabled

Models
========
The current models for generic Events are
* affinity.logger.model.Event
* affinity.logger.model.Subject
* affinity.logger.model.MetaData

The current model for Music event type are
* affinity.music.model.Music

Future Work
============
We need to have similar model and Specific event logging for the following type
* Video
* Application
* Web sites

Notes
=========
The current way to use the API is via curl. Check the README file from.
Get the code by the command
$ bzr branch lp:zeitgeist-affinity affinity
Please make sure you have the folder name as affinity and not zeitgeist-affinity

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.