getinstance
Project description
Installation
pip install getinstance
Usage
from getinstance import InstanceManager
class Country:
instances = InstanceManager()
def __init__(self, name):
self.name = name
def hello(self, username):
print(f'hello, {username} from {self.name}')
au = Country('Australia')
ru = Country('Russia')
print(list(Country.instances.all()))
print(Country.instances.get(name='Australia'))
Country.instances.filter(name='Russia').hello(username='Alice')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
getinstance-0.3.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for getinstance-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a14ccb99eeaba2e6ecfd760a5059e47ac902f1247765a028f946ffc93e21a7 |
|
MD5 | 7698812317361beb741b98c3811df58b |
|
BLAKE2b-256 | e4ea452b58c6b4ab689153679f6e96c7608502e65a4251e1811a032f65ffd86b |