Dymo v0.3.4 Dymo.Taggable View Source
Allows to easily make models taggable.
To use this module, you can simply leverage the use
macro inside
your model module:
use Dymo.Taggable
When doing so, the following functions will be added to the caller module:
all_labels/{0,1}
labeled_with/1
Doing so will require you to have a join table set up between the model and Dymo.Tag
as well as a many_to_many
relationship on your model.
For more information about their usage and typings, have a look at the Dymo.Tagger
behaviour and the Dymo.TaggerImpl
implementation.
Link to this section Summary
Functions
Add labels to the given namespace
Returns all labels associad with the given schema
Returned all objects of given type labeled with given labels
Returns all labels of the given namespace
Remove labels of given namespace
Set all labels of the given namespace, replacing existing ones
Use this macro in your Ecto schema to add tags
field
Link to this section Types
Link to this section Functions
add_labels(t(), Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
Add labels to the given namespace
add_labels(t(), Dymo.Tag.ns() | nil, Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
all_labels(module(), Dymo.Tag.ns() | nil) :: Ecto.Query.t()
Returns all labels associad with the given schema
labeled_with(module(), Dymo.Tag.label_or_labels()) :: Ecto.Query.t()
Returned all objects of given type labeled with given labels
Returns all labels of the given namespace
labels(t(), Dymo.Tag.ns() | nil) :: [Dymo.Tag.label()]
remove_labels(t(), Dymo.Tag.label() | Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
Remove labels of given namespace
remove_labels(t(), Dymo.Tag.ns() | nil, Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
set_labels(t(), Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
Set all labels of the given namespace, replacing existing ones.
set_labels(t(), Dymo.Tag.ns() | nil, Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
Use this macro in your Ecto schema to add tags
field