API Documentation

bauble

The top level module for Bauble.

bauble.Session

bauble.Session is created after the database has been opened with bauble.db.open(). bauble.Session should be used when you need to do ORM based activities on a bauble database. To create a new Session use:

session = bauble.Session()

When you are finished with the session be sure to close the session with session.close(). Failure to close sessions can lead to database deadlocks, particularly when using PostgreSQL based databases.

bauble.gui
bauble.gui is the instance :class:bauble._gui.GUI
bauble.main_is_frozen()
Return True if we are running in a py2exe environment, else return False
bauble.save_state()
Save the gui state and preferences.
bauble.quit()
Stop all tasks and quit Bauble.
bauble.set_busy(busy)
Set the interface to appear busy.
bauble.command_handler(cmd, arg)

Call a command handler.

Parameters:
  • cmd (str) – The name of the command to call
  • arg (list) – The arg to pass to the command handler
bauble.main(uri=None)
Initialize Bauble and start the main Bauble interface.

bauble.db

class bauble.db.MapperBase(classname, bases, dict_)

Bases: sqlalchemy.ext.declarative.DeclarativeMeta

MapperBase adds the id, _created and _last_updated columns to all tables.

bauble.db.open(uri, verify=True, show_error_dialogs=False)

Open a database connection. This function sets bauble.db.engine to the opened engined.

Return bauble.db.engine if successful else returns None and bauble.db.engine remains unchanged.

Parameters:
  • uri (str) – The URI of the database to open.
  • verify (bool) – Where the database we connect to should be verified as one created by Bauble. This flag is used mostly for testing.
  • show_error_dialogs (bool) – A flag to indicate whether the error dialogs should be displayed. This is used mostly for testing.
bauble.db.create(import_defaults=True)

Create new Bauble database at the current connection

Parameter:import_defaults (bool) – A flag that is passed to each plugins install() method to indicate where it should import its default data. This is mainly used for testing. The default value is True

bauble.connmgr

The connection manager provides a GUI for creating and opening connections. This is the first thing displayed when Bauble starts.

bauble.editor

bauble.editor.default_completion_cell_data_func(column, renderer, model, treeiter, data=None)
the default completion cell data function for GenericEditorView.attach_completions
bauble.editor.default_completion_match_func(completion, key_string, iter)
the default completion match function for GenericEditorView.attach_completions, does a case-insensitive string comparison of the the completions model[iter][0]
class bauble.editor.StringOrNoneValidator
If the value is an empty string then return None, else return the str() of the value.
class bauble.editor.UnicodeOrNoneValidator(encoding='utf-8')
If the value is an empty unicode string then return None, else return the unicode() of the value. The default encoding is ‘utf-8’.
class bauble.editor.IntOrNoneStringValidator
If the value is an int, long or can be cast to int then return the number, else return None
class bauble.editor.FloatOrNoneStringValidator
If the value is an int, long, float or can be cast to float then return the number, else return None
class bauble.editor.GenericEditorView(filename, parent=None)

An generic object meant to be extended to provide the view for a GenericModelViewPresenterEditor

attach_completion(entry_name, cell_data_func=<function default_completion_cell_data_func at 0xa207764>, match_func=<function default_completion_match_func at 0xa2078b4>, minimum_key_length=2, text_column=-1)

Attach an entry completion to a gtk.Entry. The defaults values for this attach_completion assumes the completion popup only shows text and that the text is in the first column of the model.

Return the completion attached to the entry.

NOTE: If you are selecting completions from strings in your model you must set the text_column parameter to the column in the model that holds the strings or else when you select the string from the completions it won’t get set properly in the entry even though you call entry.set_text().

Parameters:
  • entry_name – the name of the entry to attach the completion
  • cell_data_func – the function to use to display the rows in the completion popup
  • match_func – a function that returns True/False if the value from the model should be shown in the completions
  • minimum_key_length – default=2
  • text_column – the value of the text-column property on the entry, default is -1
cleanup()

Should be caled when after self.start() returns to cleanup undo any changes on the view.

By default all it does is call self.disconnect_all()

get_window()
Return the top level window for view
on_dialog_close(dialog, event=None)
Called if self.get_window() is a gtk.Dialog and it receives the close signal.
on_dialog_response(dialog, response, *args)
Called if self.get_window() is a gtk.Dialog and it receives the response signal.
on_window_delete(window, event=None)
Called when the window return by get_window() receives the delete event.
restore_state()
Restore the state of the view, this is usually done by getting a value by the preferences and setting the equivalent in the interface
save_state()
Save the state of the view by setting a value in the preferences that will be called restored in restore_state e.g. prefs[pref_string] = pref_value
set_widget_value(widget, value, markup=True, default=None)
Parameters:
  • widget – a widget or name of a widget in self.widgets
  • value – the value to put in the widgets
  • markup – whether the data in value uses pango markup
  • default – the default value to put in the widget if value is None
start()
Must be implemented.
class bauble.editor.GenericEditorPresenter(model, view)

the presenter of the Model View Presenter Pattern

add_problem(problem_id, problem_widgets=None)

Add problem_id to self.problems and change the background of widget(s) in problem_widgets.

problem_widgets: either a widget or list of widgets whose background color should change to indicate a problem

Parameters:
  • problem_id
  • problem_widgets
assign_completions_handler(widget, get_completions, on_select=<function <lambda> at 0xa207df4>)

Dynamically handle completions on a gtk.Entry.

Parameters:
  • widget – a gtk.Entry instance or widget name
  • get_completions – the method to call when a list of

completions is requested, returns a list of completions

Parameter:on_select – callback for when a value is selected from

the list of completions

assign_simple_handler(widget_name, model_attr, validator=None)
Assign handlers to widgets to change fields in the model.
cleanup()

Revert any changes the presenter might have done to the widgets so that next time the same widgets are open everything will be normal.

By default it only calls self.view.cleanup()

dirty()
Returns True or False depending on whether the presenter has changed anything that needs to be committed. This doesn’t necessarily imply that the session is not dirty nor is it required to change back to True if the changes are committed.
init_enum_combo(widget_name, field)
initialize a gtk.ComboBox widget with name widget_name from enum values in self.model.field
remove_problem(problem_id, problem_widgets=None)

remove problem_id from self.problems and reset the background color of the widget(s) in problem_widgets

Parameters:
  • problem_id
  • problem_widgets
set_model_attr(attr, value, validator=None)
Parameters:
  • attr – the attribute on self.model to set
  • value – the value the attribute will be set to
  • validator – validates the value before setting it

It is best to use this method to set values on the model rather than setting them directly. Derived classes can override this method to take action when the model changes.

class bauble.editor.GenericModelViewPresenterEditor(model, parent=None)

GenericModelViewPresenterEditor assume that model is an instance of object mapped to a SQLAlchemy table

attach_response(dialog, response, keyname, mask)
attach a response to dialog when keyname and mask are pressed
commit_changes()
Commit the changes.

bauble.i18n

The i18n module defines the _() function for creating translatable strings.

bauble._gui

bauble.meta

bauble.paths

Access to standard paths used by Bauble.

bauble.paths.main_dir()
Returns the path of the bauble executable.
bauble.paths.lib_dir()
Returns the path of the bauble module.
bauble.paths.locale_dir()
Returns the root path of the locale files
bauble.paths.user_dir()
Returns the path to where Bauble settings should be saved.

bauble.pluginmgr

Manage plugin registry, loading, initialization and installation. The plugin manager should be started in the following order:

1. load the plugins: search the plugin directory for plugins, populates the plugins dict (happens in load())

2. install the plugins if not in the registry, add properly installed plugins in to the registry (happens in load())

  1. initialize the plugins (happens in init())
bauble.pluginmgr.register_command(handler)

Register command handlers. If a command is a duplicate then it will overwrite the old command of the same name.

@param handler: A class which extends pluginmgr.CommandHandler

bauble.pluginmgr.load(path=None)

Search the plugin path for modules that provide a plugin. If path is a directory then search the directory for plugins. If path is None then use the default plugins path, bauble.plugins.

This method populates the pluginmgr.plugins dict and imports the plugins but doesn’t do any plugin initialization.

Parameter:path (str) – the path where to look for the plugins
bauble.pluginmgr.init(force=False)

Initialize the plugin manager.

1. Check for and install any plugins in the plugins dict that aren’t in the registry. 2. Call each init() for each plugin the registry in order of dependency 3. Register the command handlers in the plugin’s commands[]

NOTE: This should be called after after Bauble has established a connection to a database with db.open()

bauble.pluginmgr.install(plugins_to_install, import_defaults=True, force=False)
Parameters:
  • plugins_to_install – A list of plugins to install. If the string “all” is passed then install all plugins listed in the bauble.pluginmgr.plugins dict that aren’t already listed in the plugin registry.
  • import_defaults (bool) – Flag passed to the plugin’s install() method to indicate whether it should import its default data.
  • force (book) – Force, don’t ask questions.
class bauble.pluginmgr.Plugin
tools:
a list of BaubleTool classes that this plugin provides, the tools’ category and label will be used in Bauble’s “Tool” menu
depends:
a list of names classes that inherit from BaublePlugin that this plugin depends on
cmds:
a map of commands this plugin handled with callbacks, e.g dict(‘cmd’, lambda x: handler)
description:
a short description of the plugin
classmethod init()
init() is run when Bauble is first started
classmethod install(import_defaults=True)
install() is run when a new plugin is installed, it is usually only run once for the lifetime of the plugin
class bauble.pluginmgr.Tool
class bauble.pluginmgr.View(*args, **kwargs)
class bauble.pluginmgr.CommandHandler

bauble.prefs

bauble.task

The bauble.task module allows you to queue up long running tasks. The running tasks still block but allows the GUI to update.

bauble.task.queue(task)
Run a task.
bauble.task.set_message(msg)
A convenience function for setting a message on the statusbar. Returns the message id
bauble.task.clear_messages()
Clear all the messages from the statusbar that were set with bauble.task.set_message()

bauble.types

class bauble.types.Enum(values, empty_to_none=False, strict=True, **kwargs)

Bases: sqlalchemy.types.TypeDecorator

A database independent Enum type. The value is stored in the database as a Unicode string.

class bauble.types.Date(*args, **kwargs)

Bases: sqlalchemy.types.TypeDecorator

A Date type that allows Date strings

class bauble.types.DateTime(*args, **kwargs)

Bases: sqlalchemy.types.TypeDecorator

A DateTime type that allows strings

bauble.utils

A common set of utility functions used throughout Bauble.

bauble.utils.find_dependent_tables(table, metadata=None)

Return an iterator with all tables that depend on table. The tables are returned in the order that they depend on each other. For example you know that table[0] does not depend on tables[1].

Parameters:
  • table – The tables who dependencies we want to find
  • metadata – The sqlalchemy.engine.Metadata object that holds the tables to search through. If None then use bauble.db.metadata
bauble.utils.tree_model_has(tree, value)
Return True or False if value is in the tree.
bauble.utils.search_tree_model(parent, data, cmp=<function <lambda> at 0xa00dd84>)

Return a iterable of gtk.TreeIter instances to all occurences of data in model

Parent:a gtk.TreeModel or a gtk.TreeModelRow instance
Data:the data to look for
Cmp:the function to call on each row to check if it matches data, default is C{lambda row, data: row[0] == data}
bauble.utils.clear_model(obj_with_model)
Parameter:obj_with_model – a gtk Widget that has a gtk.TreeModel that can be retrieved with obj_with_mode.get_model

Remove the model from the object, deletes all the items in the model, clear the model and then delete the model and set the model on the object to None

bauble.utils.combo_set_active_text(combo, value)
does the same thing as set_combo_from_value but this looks more like a GTK+ method
bauble.utils.set_combo_from_value(combo, value, cmp=<function <lambda> at 0xa00de64>)

find value in combo model and set it as active, else raise ValueError cmp(row, value) is the a function to use for comparison

Note

if more than one value is found in the combo then the first one in the list is set

bauble.utils.combo_get_value_iter(combo, value, cmp=<function <lambda> at 0xa00ded4>)

Returns a gtk.TreeIter that points to first matching value in the combo’s model.

Parameters:
  • combo – the combo where we should search
  • value – the value to search for
  • cmp – the method to use to compare rows in the combo model and value, the default is C{lambda row, value: row[0] == value}

Note

if more than one value is found in the combo then the first one in the list is returned

bauble.utils.set_widget_value(widget, value, markup=True, default=None)
Parameters:
  • widget – an instance of gtk.Widget
  • value – the value to put in the widget
  • markup – whether or not
  • default – the default value to put in the widget if the value is None

Note

any values passed in for widgets that expect a string will call the values __str__ method

bauble.utils.create_message_dialog(msg, type=<enum GTK_MESSAGE_INFO of type GtkMessageType>, buttons=<enum GTK_BUTTONS_OK of type GtkButtonsType>, parent=None)

Create a message dialog.

Parameters:
  • msg – The markup to use for the message. The value should be escaped in case it contains any HTML entities.
  • type – A GTK message type constant. The default is gtk.MESSAGE_INFO.
  • buttons – A GTK buttons type constant. The default is gtk.BUTTONS_OK.
  • parent – The parent window for the dialog

Returns a gtk.MessageDialog

bauble.utils.message_dialog(msg, type=<enum GTK_MESSAGE_INFO of type GtkMessageType>, buttons=<enum GTK_BUTTONS_OK of type GtkButtonsType>, parent=None)

Create a message dialog with bauble.utils.create_message_dialog() and run and destroy it.

Returns the dialog’s response.

bauble.utils.create_yes_no_dialog(msg, parent=None)
Create a dialog with yes/no buttons.
bauble.utils.yes_no_dialog(msg, parent=None, yes_delay=-1)

Create and run a yes/no dialog.

Return True if the dialog response equals gtk.RESPONSE_YES

Parameters:
  • msg – the message to display in the dialog
  • parent – the dialog’s parent
  • yes_delay – the number of seconds before the yes button should become sensitive
bauble.utils.create_message_details_dialog(msg, details, type=<enum GTK_MESSAGE_INFO of type GtkMessageType>, buttons=<enum GTK_BUTTONS_OK of type GtkButtonsType>, parent=None)
Create a message dialog with a details expander.
bauble.utils.message_details_dialog(msg, details, type=<enum GTK_MESSAGE_INFO of type GtkMessageType>, buttons=<enum GTK_BUTTONS_OK of type GtkButtonsType>, parent=None)
Create and run a message dialog with a details expander.
bauble.utils.setup_text_combobox(combo, values=[], cell_data_func=None)

Configure a gtk.ComboBox as a text combobox

NOTE: If you pass a cell_data_func that is a method of an object that holds a reference to combo then the object will not be properly garbage collected. To avoid this problem either don’t pass a method of object or make the method static

bauble.utils.setup_date_button(entry, button, date_func=None)
Parameters:
  • entry – the entry that the data goes into
  • button – the button that enters the data in entry
  • date_func – the function that returns a string represention of the date
bauble.utils.to_unicode(obj, encoding='utf-8')
Return obj converted to unicode. If obj is already a unicode object it will not try to decode it to converted it to <encoding> but will just return the original obj
bauble.utils.utf8(obj)
This function is an alias for to_unicode(obj, ‘utf-8’)
bauble.utils.xml_safe(obj, encoding='utf-8')
Return a string with character entities escaped safe for xml, if the str parameter is a string a string is returned, if str is a unicode object then a unicode object is returned
bauble.utils.xml_safe_utf8(obj)
This method is deprecated and just returns xml_safe(obj)
bauble.utils.natsort_key(obj)

a key getter for sort and sorted function

the sorting is done on return value of obj.__str__() so we can sort objects as well, i don’t know if this will cause problems with unicode

use like: sorted(some_list, key=utils.natsort_key)

bauble.utils.delete_or_expunge(obj)
If the object is in object_session(obj).new then expunge it from the session. If not then session.delete it.
bauble.utils.reset_sequence(column)

If column.sequence is not None or the column is an Integer and column.autoincrement is true then reset the sequence for the next available value for the column...if the column doesn’t have a sequence then do nothing and return

The SQL statements are executed directly from db.engine

bauble.utils.date_to_str(date, format)
Parameters:
  • data – a datetime object
  • format – the format of the string to return, uses: yyyy,yy,d,dd,m,mm

We don’t do any validation that the format is correct or invalid

bauble.utils.make_label_clickable(label, on_clicked, *args)
Parameters:
  • label – a gtk.Label that has a gtk.EventBox as it’s parent
  • on_clicked – callback to be called when the label is clicked on_clicked(label, event, data)
bauble.utils.enum_values_str(col)
Parameter:col – a string if table.col where col is an enum type

return a string with of the values on an enum type join by a comma

bauble.view

class bauble.view.InfoBox(tabbed=False)

Bases: gtk.Notebook

Holds list of expanders with an optional tabbed layout.

The default is to not use tabs. To create the InfoBox with tabs use InfoBox(tabbed=True). When using tabs then you can either add expanders directly to the InfoBoxPage or using InfoBox.add_expander with the page_num argument.

on_switch_page(notebook, dummy_page, page_num, *args)
Called when a page is switched
add_expander(expander, page_num=0)

Add an expander to a page.

Parameters:
  • expander – The expander to add.
  • page_num – The page number in the InfoBox to add the expander.
update(row)
Update the current page with row.
class bauble.view.InfoBoxPage

Bases: gtk.ScrolledWindow

A gtk.ScrolledWindow that contains bauble.view.InfoExpander objects.

add_expander(expander)

Add an expander to the list of exanders in this infobox

Parameter:expander – the bauble.view.InfoExpander to add to this infobox
get_expander(label)

Returns an expander by the expander’s label name

Parameter:label – the name of the expander to return
remove_expander(label)

Remove expander from the infobox by the expander’s label bel

Parameter:label – the name of th expander to remove

Return the expander that was removed from the infobox.

update(row)

Updates the infobox with values from row

Parameter:row – the mapper instance to use to update this infobox, this is passed to each of the infoexpanders in turn
class bauble.view.InfoExpander(label, widgets=None)

Bases: gtk.Expander

an abstract class that is really just a generic expander with a vbox to extend this you just have to implement the update() method

set_widget_value(widget_name, value, markup=True, default=None)
a shorthand for L{bauble.utils.set_widget_value()}
update(value)
This method should be implemented by classes that extend InfoExpander
class bauble.view.PropertiesExpander

Bases: bauble.view.InfoExpander

update(row)
” Update the widget in the expander.
class bauble.view.SearchParser

The parser for bauble.view.MapperSearch

parse_string(text)
returns a pyparsing.ParseResults objects that represents either a query, an expression or a list of values
class bauble.view.SearchStrategy

Interface for adding search strategies to a view.

search(text, session)
Parameter:text – the search string
Param:the session to use for the search

Return an iterator that iterates over mapped classes retrieved from the search.

class bauble.view.MapperSearch

Bases: bauble.view.SearchStrategy

Mapper Search support three types of search expression: 1. value searches: search that are just list of values, e.g. value1, value2, value3, searches all domains and registered columns for values 2. expression searches: searched of the form domain=value, resolves the domain and searches specific columns from the mapping 3. query searchs: searches of the form domain where ident.ident = value, resolve the domain and identifiers and search for value

search(text, session)

Returns a ResultSet of database hits for the text search string.

If session=None then the session should be closed after the results have been processed or it is possible that some database backends could cause deadlocks.

class bauble.view.ResultSet(results=None)

A ResultSet represents a set of results returned from a query, it allows you to add results to the set and then iterate over all the results as if they were one set. It will only return objects that are unique between all the results.

count()
return the number of total results from all of the members of this results set, does not take into account duplicate results
clear()
Clear out the set.
class bauble.view.SearchView

Bases: bauble.pluginmgr.View

The SearchView is the main view for Bauble. It manages the search results returned when search strings are entered into the main text entry.

class bauble.view.SearchView.ViewMeta

bauble.plugins.plants

class bauble.plugins.plants.Family(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

family

Columns:
family:

The name if the family. Required.

qualifier:

The family qualifier.

Possible values:
    1. lat.: aggregrate family (senso lato)
    1. str.: segregate family (senso stricto)
  • ‘’: the empty string
notes:

Free text notes about the family.

Properties:
synonyms:

An association to _synonyms that will automatically convert a Family object and create the synonym.

Constraints:

The family table has a unique constraint on family/qualifier.

class bauble.plugins.plants.FamilySynonym(synonym=None, **kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

family_synonyms

Columns:

family_id:

synonyms_id:

Properties:

synonyms:

family:

class bauble.plugins.plants.Genus(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

genus

Columns:
genus:

The name of the genus.

qualifier:

Designates the botanical status of the genus.

Possible values:
    1. lat.: aggregrate genus (sensu lato)
    1. str.: segregate genus (sensu stricto)

author:

notes:

Properties:

family:

synonyms:

Contraints:

The combination of genus, author, qualifier and family_id must be unique.

class bauble.plugins.plants.GenusSynonym(synonym=None, **kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:genus_synonym
class bauble.plugins.plants.Species(*args, **kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

species

Columns:
hybrid:

Hybrid flag

sp_qual:

Species qualifier

Possible values:

agg.: An aggregate species

s. lat.: aggregrate species (sensu lato)

s. str.: segregate species (sensu stricto)

infrasp_rank:

The infraspecific rank

Possible values:

subsp.: subspecies

variety.: variety

subvar.: sub variety

f.: form

subf.: subform

cv.: cultivar

infrasp:

The infraspecific epithet

Properties:

accessions:

vernacular_names:

default_vernacular_name:

synonyms:

distribution:

Constraints:

The combination of sp, sp_author, hybrid, sp_qual, cv_group, trade_name, infrasp, infrasp_author, infrasp_rank, genus_id

class bauble.plugins.plants.SpeciesSynonym(synonym=None, **kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:species_synonym
class bauble.plugins.plants.VernacularName(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

vernacular_name

Columns:
name:

the vernacular name

language:

language is free text and could include something like UK or US to identify the origin of the name

species_id:

key to the species this vernacular name refers to

Properties:
Constraints:
class bauble.plugins.plants.DefaultVernacularName(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:default_vernacular_name

DefaultVernacularName is not meant to be instantiated directly. Usually the default vernacular name is set on a species by setting the default_vernacular_name property on Species to a VernacularName instance

Columns:
id:

Integer, primary_key

species_id:

foreign key to species.id, nullable=False

vernacular_name_id:

Properties:
Constraints:
class bauble.plugins.plants.SpeciesDistribution(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:species_distribution
Columns:
Properties:
Constraints:
class bauble.plugins.plants.Geography(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Represents a geography unit.

Table name:

geography

Columns:

name:

tdwg_code:

iso_code:

parent_id:

Properties:

children:

Constraints:

bauble.plugins.garden

class bauble.plugins.garden.Accession(*args, **kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

accession

Columns:
code: sqlalchemy.types.Unicode

the accession code

prov_type: bauble.types.Enum

the provenance type

Possible values:
  • Wild:
  • Propagule of cultivated wild plant
  • Not of wild source
  • Insufficient Data
  • Unknown
wild_prov_status: bauble.types.Enum

wild provenance status, if prov_type is Wild then this column can be used to give more provenance information

Possible values:
  • Wild native
  • Cultivated native
  • Insufficient Data
  • Unknown
date: bauble.types.Date

the date this accession was accessioned

source_type: bauble.types.Enum

The type of the source of this accession

Possible values:

notes: sqlalchemy.types.UnicodeText

Notes relating to this accession.

id_qual: bauble.types.Enum

The id qualifier is used to indicate uncertainty in the identification of this accession

Possible values:
  • aff. - affinity with
  • cf. - compare with
  • forsan - perhaps
  • near - close to
  • ? - questionable
  • incorrect
id_qual_rank: sqlalchemy.types.Unicode

The rank of the species that the id_qaul refers to.

private: sqlalchemy.types.Boolean

Flag to indicate where this information is sensitive and should be kept private

species_id: sqlalchemy.types.ForeignKey

foreign key to the species table

Properties:
species:

the species this accession refers to

_collection:

this relation should never be used directly, use the source property instead

_donation:

this relations should never be used directly, use the source property instead

source:

source cancel either be a Donation, Collection or None depending on the value of the source_type

plants:

a list of plants related to this accession

verifications:

a list of verifications on the identification of this accession

Constraints:
class bauble.plugins.garden.Plant(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

plant

Columns:
code: sqlalchemy.types.Unicode

The plant code

acc_type: bauble.types.Enum

The accession type

Possible values:
  • Plant: Whole plant
  • Seed/Spore: Seed or Spore
  • Vegetative Part: Vegetative Part
  • Tissue Culture: Tissue culture
  • Other: Other, probably see notes for more information
  • None: no information, unknown
acc_status: bauble.types.Enum

The accession status

Possible values:
  • Living accession: Current accession in living collection
  • Dead: Noncurrent accession due to Death
  • Transfered: Noncurrent accession due to Transfer Stored in dormant state: Stored in dormant state
  • Other: Other, possible see notes for more information
  • None: no information, unknown)
notes: sqlalchemy.types.UnicodeText

Notes

accession_id: sqlalchemy.types.ForeignKey

Required.

location_id: sqlalchemy.types.ForeignKey

Required.

Properties:
accession:

The accession for this plant.

location:

The location for this plant.

Constraints:

The combination of code and accession_id must be unique.

classmethod get_delimiter()

Get the plant delimiter from the BaubleMeta table.

The delimiter is cached the first time it is retrieved. To refresh the delimiter from the database call with refresh=True.

class bauble.plugins.garden.Location(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

location

Columns:

site:

description:

Relation:

plants:

class bauble.plugins.garden.Collection(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

collection

Columns:

collector: sqlalchemy.types.Unicode(64)

collectors_code: sqlalchemy.types.Unicode(50)

date: sqlalchemy.types.Date

locale: sqlalchemy.types.UnicodeText(nullable=False)

latitude: sqlalchemy.types.Float

longitude: sqlalchemy.types.Float

gps_datum: sqlalchemy.types.Unicode(32)

geo_accy: sqlalchemy.types.Float

elevation: sqlalchemy.types.Float

elevation_accy: sqlalchemy.types.Float

habitat: sqlalchemy.types.UnicodeText

geography_id: sqlalchemy.types.Integer(ForeignKey('geography.id'))

notes: sqlalchemy.types.UnicodeText

accession_id: sqlalchemy.types.Integer(ForeignKey('accession.id'), nullable=False)

Properties:

Also contains an _accession property that was created as a backref from the Accession mapper

Constraints:
class bauble.plugins.garden.Donation(**kwargs)

Bases: sqlalchemy.ext.declarative.Base

Table name:

donation

Columns:

donor_id: sqlalchemy.types.Integer(ForeignKey('donor.id'), nullable=False)

donor_acc: sqlalchemy.types.Unicode(32)

notes: sqlalchemy.types.UnicodeText

date: bauble.types..Date

accession_id: sqlalchemy.types.Integer(ForeignKey('accession.id'), nullable=False)

Properties:
donor:

created as a backref from the Donor mapper

_accession:

created as a backref from the Accession mapper _donation property

class bauble.plugins.garden.Donor(**kwargs)
Bases: sqlalchemy.ext.declarative.Base

bauble.plugins.abcd

bauble.plugins.imex

bauble.plugins.report

bauble.plugins.report.xsl

The PDF report generator module.

This module takes a list of objects, get all the plants from the objects, converts them to the ABCD XML format, transforms the ABCD data to an XSL formatting stylesheet and uses a XSL-PDF renderer to convert the stylesheet to PDF.

bauble.plugins.report.mako

bauble.plugins.tag