onbasca.base.models package¶
Submodules¶
onbasca.base.models.base module¶
onbasca.base.models.bridge module¶
Bridge base model.
- class onbasca.base.models.bridge.BridgeBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- bridgeline¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- fingerprint¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects¶
- class onbasca.base.models.bridge.BridgeManagerBase(*args, **kwargs)[source]¶
Bases:
BaseManager
- onbasca.base.models.bridge.fingerprint_from_bridgeline(bridgeline)[source]¶
Obtain the bridge fingerprint from a bridge line.
From
7. Displaying Bridge Information
(https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/bridgedb-spec.txt#L357) Bridges are formatted as:<address:port> NL
Pluggable transports are formatted as:
<transportname> SP <address:port> [SP arglist] NL
- Example::
with transport:: obfs4 <ip>:<port> <fingerprint> cert=<cert> iat-mode=<iat-mode>
without transport:: <ip>:<port> <fingerprint>
onbasca.base.models.bwfile module¶
- class onbasca.base.models.bwfile.BwFileBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- file_created¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- latest_bandwidth¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects¶
- scanner_country¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- software¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- software_version¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- tor_version¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
onbasca.base.models.consensus module¶
- class onbasca.base.models.consensus.ConsensusBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- get_next_by_valid_after(*, field=<django.db.models.fields.DateTimeField: valid_after>, is_next=True, **kwargs)¶
- get_previous_by_valid_after(*, field=<django.db.models.fields.DateTimeField: valid_after>, is_next=False, **kwargs)¶
- objects¶
- valid_after¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
onbasca.base.models.relay module¶
- class onbasca.base.models.relay.RelayBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- are_relaydescs_observed_bandwidth_0()[source]¶
Return True if any of the descriptors have observed bandwidth.
#41: This method is only to log when this happen. It will be logged when the generator scales the bandwidth.
- consensuses¶
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.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- fingerprint¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects¶
onbasca.base.models.relaybw module¶
- class onbasca.base.models.relaybw.RelayBwBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- class Meta[source]¶
Bases:
object
- abstract = False¶
- get_latest_by = 'measured_at'¶
- unique_together = ['fingerprint', 'bwfile']¶
- bw¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- consensus_bandwidth¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- consensus_bandwidth_is_unmeasured¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- desc_bw_avg¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- desc_bw_bur¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- desc_bw_obs_last¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- error_circ¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- error_stream¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- fingerprint¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- measured_at¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- nickname¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects¶
- relay_in_recent_consensus_count¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- relay_recent_measurement_attempt_count¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- relay_recent_measurement_failure_count¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- relay_recent_measurements_excluded_error_count¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- relay_recent_priority_list_count¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- success¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- under_min_report¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- updated_at¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- vote¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
onbasca.base.models.relaydesc module¶
- class onbasca.base.models.relaydesc.RelayDescBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- class Meta[source]¶
Bases:
object
- abstract = False¶
- get_latest_by = 'published'¶
- unique_together = ('published', 'fingerprint')¶
- average_bandwidth¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- burst_bandwidth¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- can_exit_443¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- ed25519_master_key¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- fingerprint¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- nickname¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects¶
- observed_bandwidth¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- published¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
onbasca.base.models.routerstatus module¶
- class onbasca.base.models.routerstatus.RouterStatusBase(*args, **kwargs)[source]¶
Bases:
BaseModel
- class Meta[source]¶
Bases:
object
- abstract = False¶
- get_latest_by = 'published'¶
- unique_together = ('consensus', 'fingerprint')¶
- address¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- bandwidth¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- fingerprint¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_exit¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_unmeasured¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- nickname¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects¶
- published¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.