aggregator.pipes.models¶
Graph of models in the aggregator.pipes app and related apps.
Defines a class for a data platform’s API. Stores information on an API’s rate limits and parameter limits. Also stores information on how to access the specific class needed to handle a query to the API.
-
class
aggregator.pipes.models.Pipe(*args, **kwargs)[source]¶ Bases:
ambassador.endpoints.models.EndpointSpecifies the module and
Faucetclass that should be used to access an API endpoint of aReservoir, such as Twitter.A
Pipecan have aPipeSpecSheetthat details information on the API’s parameter limits.Since a
Reservoirmay be accessed using more than one API (e.g., Twitter Search API vs. Twitter Public API),Pipeshave a many-to-one relationship withReservoirs.-
platform¶ |Reservoir| – The data platform which the API endpoint accesses.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
datachute_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
emissaries¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
pizza.toppingsandtopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
funnel_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
gateway_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects= <ambassador.endpoints.models.EndpointManager object>¶
-
platform Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parentis aForwardManyToOneDescriptorinstance.
-
platform_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
sample¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
place.restaurantis aReverseOneToOneDescriptorinstance.
-
specsheet¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
place.restaurantis aReverseOneToOneDescriptorinstance.
-
stream_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
-
class
aggregator.pipes.models.PipeSpecSheet(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelContains info on search parameter formats and limits.
-
pipe¶ the ForeignKey for the Pipe with which the SpecSheet is associated
-
streaming¶ a Boolean indicating whether the API endpoint is for streaming
-
searchterms_limit¶ the maximum number of search terms allowed in a query
-
followees_limit¶ the maximum number of user accounts that can be included in a query
-
locations_limit¶ the maximum number of locations that can be searched in a query
-
location_format¶ whether the API takes a location as a bounding box or a search radius
-
radius_limit_km¶ the maximum radius of a search area accepted, in kilometers
-
combine_trm_dt¶ a Boolean indicating whether timeframes count toward the search term limit; if true, start datetime and end datetime each count as a search term
-
combine_trm_fol¶ a Boolean indicating whether search terms and followees share the same parameter space and therefore the same limit; if true, also indicates than terms and followees can be joined with an “OR” operator if one is available
-
combine_trm_loc¶ a Boolean indicating whether search terms and locations share the same parameter space and therefore the same limit; if true, also indicates than terms and locations can be joined with an “OR” operator if one is available
-
combine_trm_opr¶ a Boolean indicating whether logical operators count toward the search term limit
-
accepts_phrases¶ whether the API accepts phrases (if False, only takes keywords)
-
trm_trm_logic¶ a logical “AND” or “OR” operator indicating how multiple terms are evaluated in a query (i.e., with an intersection vs. a union of results)
-
trm_fol_logic¶ a logical “AND” or “OR” operator indicating how terms and followees are evaluated in a query (i.e., with an intersection vs. a union of results)
-
trm_loc_logic¶ a logical “AND” or “OR” operator indicating how terms and locations are evaluated in a query (i.e., with an intersection vs. a union of results)
-
OR_operator¶ a string that the API uses as an “OR” operator; can be used to join arguments in the search terms parameter space
-
NOT_operator¶ a string that the API uses as a “NOT” operator
-
#TODO LH – add validator that makes sure logic fields have values if limits are > 1
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
NOT_operator A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
OR_operator A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
accepts_phrases A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
combine_trm_dt A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
combine_trm_fol A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
combine_trm_loc A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
combine_trm_opr A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
followees_limit A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_location_format_display(**morekwargs)¶
-
get_trm_fol_logic_display(**morekwargs)¶
-
get_trm_loc_logic_display(**morekwargs)¶
-
get_trm_trm_logic_display(**morekwargs)¶
-
location_format A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
locations_limit A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects= <django.db.models.manager.Manager object>¶
-
pipe Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
restaurant.placeis aForwardOneToOneDescriptorinstance.
-
pipe_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
radius_limit_km A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
searchterms_limit A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
streaming A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
trm_fol_logic A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
trm_loc_logic A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
trm_trm_logic A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
