forked from uncloud/uncloud
move uncloud a layer up
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
1d1ae6fb3e
commit
94633d6cc8
70 changed files with 99 additions and 50 deletions
26
uncloud/uncloud_api/management/commands/hack.py
Normal file
26
uncloud/uncloud_api/management/commands/hack.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import time
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
import uncloud_api.models
|
||||
|
||||
import inspect
|
||||
import sys
|
||||
import re
|
||||
|
||||
class Command(BaseCommand):
|
||||
args = '<None>'
|
||||
help = 'hacking - only use if you are Nico'
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('command', type=str, help='Command')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
getattr(self, options['command'])(**options)
|
||||
|
||||
@classmethod
|
||||
def classtest(cls, **_):
|
||||
clsmembers = inspect.getmembers(sys.modules['uncloud_api.models'], inspect.isclass)
|
||||
for name, c in clsmembers:
|
||||
if re.match(r'.+Product$', name):
|
||||
print("{} -> {}".format(name, c))
|
||||
Loading…
Add table
Add a link
Reference in a new issue