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.4.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for getinstance-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224312f44e95e3c8bfe5975438d7ab6a81a9cc87f6e59a359cae25f742f4d73a |
|
MD5 | 3412cbc7bf251c3182d339cfd3f84a8b |
|
BLAKE2b-256 | 5076751e4ea3d5d2c8100ebbd4aa3975677649194eefebaaecad4a0518add7be |