economy.models

Define economy related models.

Copyright (C) 2018 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.

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, *args, **kwargs)

Override the SuperModel save to 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)

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.

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.

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.

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.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)

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.

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.