economy.models

Define economy related models.

Copyright (C) 2021 Gitcoin Core

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

get_time

get_time()

Get the local time.

get_0_time

get_0_time()

Get the local time.

SuperModel

SuperModel(self, *args, **kwargs)

Define the base abstract model.

created_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

_method

SuperModel._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)

_method

SuperModel._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)

_method

SuperModel._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)

_method

SuperModel._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)

modified_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Meta

SuperModel.Meta(self, /, *args, **kwargs)

Define the model metadata.

save

SuperModel.save(self, update=True, *args, **kwargs)

Override the SuperModel save to optionally handle modified_on logic.

to_standard_dict

SuperModel.to_standard_dict(self, fields=None, exclude=None, properties=None)

Define the standard to dict representation of the object.

Args: fields (list): The list of fields to include. If not provided, include all fields. If not provided, all fields are included. Defaults to: None. exclude (list): The list of fields to exclude. If not provided, no fields are excluded. Default to: None.

Returns: dict: The dictionary representation of the object.

ConversionRate

ConversionRate(self, *args, **kwargs)

Define the conversion rate model.

from_amount

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

from_currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

_method

ConversionRate._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)

_method

ConversionRate._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)

_method

ConversionRate._method(self, *, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)

_method

ConversionRate._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)

_method

ConversionRate._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)

_method

ConversionRate._method(self, *, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=False, **kwargs)

_method

ConversionRate._method(self, *, field=<django.db.models.fields.CharField: source>)

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

source

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SOURCE_TYPES

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

timestamp

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

to_amount

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

to_currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

reverse_conversion_rate

reverse_conversion_rate(sender, instance, **kwargs)

Handle the reverse conversion rate signal during post-save.

TXUpdate

TXUpdate(self, *args, **kwargs)

Define the TXUpdate model.

body

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

_method

TXUpdate._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)

_method

TXUpdate._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)

_method

TXUpdate._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)

_method

TXUpdate._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

processed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Token

Token(self, *args, **kwargs)

Define the Token model.

address

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

approved

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

chain_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

clrmatch_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.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

conversion_rate_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

CONVERSION_RATE_SOURCE

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

conversion_rate_source

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

decimals

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

_method

Token._method(self, *, field=<django.db.models.fields.CharField: conversion_rate_source>)

_method

Token._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)

_method

Token._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)

_method

Token._method(self, *, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)

_method

Token._method(self, *, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)

grantpayout_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.children is a ReverseManyToOneDescriptor instance.

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.

metadata

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

network

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

network_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

priority

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

symbol

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.