dataplot.plotmodels
index
/home/thocking/dataplot/docs/htdocs/pydoc/dataplot/plotmodels.py

Auto-define and -update mechanism for django-dataplot images.
 
Comment out this line in your models.py:
# from django.db import models
 
Then add:
from dataplot import plotmodels as models

 
Modules
       
django.db.models.base
dataplot
datetime
decimal
django.dispatch.dispatcher
django.db.models.fields
django.newforms
django.db.models.loading
django.db.models.manager
django.db.models.manipulators
django.oldforms
django.db.models.options
os
pdb
django.db.models.query
re
django.db.models.fields.related
django.db.models.signals
time
django.core.validators

 
Classes
       
__builtin__.dict(__builtin__.object)
Dataplot
dataplot.PlotError(exceptions.Exception)
DataplotImproperlyConfigured
django.db.models.base.Model(__builtin__.object)
Model
django.db.models.base.ModelBase(__builtin__.type)
ModelBase

 
class Dataplot(__builtin__.dict)
    Parsing logic for dataplot autoconfig tuples.
 
This is just used for DRY convenience here and should not be used
outside this module.
 
 
Method resolution order:
Dataplot
__builtin__.dict
__builtin__.object

Methods defined here:
__init__(self, plot, toset)
Initialize a dataplot using sensible defaults.
 
This can be a
 
dataplot (subclass of dataplot.GenericPlot, i.e. R.Scatter) in
this case, we assume basename of scatter and a plot method
called get_scatter_args.
 
tuple (dataplot,dict) where dict is a dictionary of kwargs
used to initialize the dataplot. So you can use this form if
you want to override the default basename, get_plot_args
method, or other plot parameters.
defaults(self)
Derive sensible defaults from provided info.
set_attribute(self)
Set dataplot instance.
set_method(self)
Set data-gathering method if necessary.

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Dataplot' objects>
list of weak references to the object (if defined)

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class DataplotImproperlyConfigured(dataplot.PlotError)
    
Method resolution order:
DataplotImproperlyConfigured
dataplot.PlotError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class Model(django.db.models.base.Model)
    Enables figure autosave with Django-dataplot.
 
All attributes of this model which are instances of
dataplot.GenericPlot will be resaved.
 
 
Method resolution order:
Model
django.db.models.base.Model
__builtin__.object

Methods defined here:
__init__(self, *args, **kwargs)
make_model_plots(self, force=True)
Try to remake plots related to this model.
save(self)
Save method which allows for maximum configurability.
 
On a model with no custom save method, we will call django's
save first, then try to make plots for this object.
 
On a model with a custom save method, you should call
make_plots and Model.save yourself, depending on when it is
appropriate in terms of your data processing.
save_plots(self)

Class methods defined here:
make_manager_plots(cls, force=True) from ModelBase
Try to remake plots related to this model's manager.

Data and other attributes defined here:
AddManipulator = <class 'django.db.models.manipulators.AddManipulator'>
ChangeManipulator = <class 'django.db.models.manipulators.ChangeManipulator'>
DoesNotExist = <class django.db.models.base.DoesNotExist>
MultipleObjectsReturned = <class django.db.models.base.MultipleObjectsReturned>
__metaclass__ = <class 'dataplot.plotmodels.ModelBase'>
Extend ModelBase to initialize dataplots.
objects = <django.db.models.manager.Manager object>

Methods inherited from django.db.models.base.Model:
__eq__(self, other)
__hash__(self)
__ne__(self, other)
__repr__(self)
__str__(self)
delete(self)
validate(self)
First coerces all fields on this instance to their proper Python types.
Then runs validation on every field. Returns a dictionary of
field_name -> error_list.

Properties inherited from django.db.models.base.Model:
pk
get = _get_pk_val(self)
set = _set_pk_val(self, value)

Data and other attributes inherited from django.db.models.base.Model:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Model' objects>
list of weak references to the object (if defined)

 
class ModelBase(django.db.models.base.ModelBase)
    Extend ModelBase to initialize dataplots.
 
 
Method resolution order:
ModelBase
django.db.models.base.ModelBase
__builtin__.type
__builtin__.object

Methods defined here:
__init__(self, *posargs, **kwargs)
automatic dataplot construction based on DATAPLOTS syntax

Methods inherited from django.db.models.base.ModelBase:
add_to_class(cls, name, value)

Static methods inherited from django.db.models.base.ModelBase:
__new__(cls, name, bases, attrs)

Methods inherited from __builtin__.type:
__call__(...)
x.__call__(...) <==> x(...)
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__hash__(...)
x.__hash__() <==> hash(x)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__subclasses__(...)
__subclasses__() -> list of immediate subclasses
mro(...)
mro() -> list
return a type's method resolution order

Data and other attributes inherited from __builtin__.type:
__base__ = <class 'django.db.models.base.ModelBase'>
__bases__ = (<class 'django.db.models.base.ModelBase'>,)
__basicsize__ = 420
__dict__ = <dictproxy object>
__dictoffset__ = 132
__flags__ = 22523
__itemsize__ = 20
__mro__ = (<class 'dataplot.plotmodels.ModelBase'>, <class 'django.db.models.base.ModelBase'>, <type 'type'>, <type 'object'>)
__weakrefoffset__ = 184

 
Functions
       
call_if_possible(i)
get_plot_args(self, kwargs)
To be curried and used as a method for plotting.
make_plots(x, force)
Look for dataplots in attributes, and remake them.
tee(...)
tee(iterable, n=2) --> tuple of n independent iterators.

 
Data
        ADD = 1
BLANK_CHOICE_DASH = [('', '---------')]
BLANK_CHOICE_NONE = [('', 'None')]
BOTH = 3
CHANGE = 2
HORIZONTAL = 1
STACKED = 2
TABULAR = 1
UNSAFE_FILE_CHARS = <_sre.SRE_Pattern object>
VERTICAL = 2
connection = <django.db.backends.postgresql.base.DatabaseWrapper object>
settings = <django.conf.LazySettings object>