from .client import Client
from .manager import Manager
from .user import User
from .super_manager import SuperManager
class Admin(User):
def create_user(self,name,type_of_user:[Client, Manager, SuperManager]):
return type_of_user(name)
def delete_user(self, name):
return f"Пользователь{name} успешно удален"
from .user import User
class Person(User):
def __init__(self, name, country):
"""Initialize fields name, country"""
super().__init__(name)
self.country = country
def get_country(self):
"""return country"""
return self.country
class User:
def __init__(self, name):
"""Initialize fields name"""
self.name = name
self.posts = []
def get_name(self):
"""return name of user"""
return self.name
def post(self, msg):
"""add post to user posts"""
self.posts.append(msg)
def get_all_my_posts(self):
"""return posts in reverse order(fresh is first)"""
fresh_first = self.posts[:]
fresh_first.reverse()
return fresh_first