console.py
def do_create(self, line):
        """creates a new instance of BaseModel, saves it and prints the id"""
        args = line.split()
        if len(args) == 0:
            print("** class name missing **")
        elif args[0] not in new_c_list:
            print("** class doesn't exist **")
        else:
            for key, value in c_list.items():
                if args[0] == key:
                    new_instance = value()
                    print(new_instance.id)
                    new_instance.save()
creates a new instance of BaseModel, saves it and prints the id
creates a new instance of BaseModel, saves it and prints the id
creates a new instance of BaseModel saves it and prints the id
def do_create(self, line):
        args = line.split()
        if len(args) == 0:
            print("** class name missing **")
        elif args[0] not in new_c_list:
            print("** class doesn't exist **")
        else:
            for key, value in c_list.items():
                if args[0] == key:
                    new_instance = value()
                    print(new_instance.id)
                    new_instance.save()
def do_create ( self , line ) : args = line . split ( ) if len ( args ) == 0 : print ( "** class name missing **" ) elif args [ 0 ] not in new_c_list : print ( "** class doesn't exist **" ) else : for key , value in c_list . items ( ) : if args [ 0 ] == key : new_instance = value ( ) print ( new_instance . id ) new_instance . save ( )
creates a new instance of BaseModel, saves it and prints the id
creates a new instance of BaseModel saves it and prints the id
"""creates a new instance of BaseModel, saves it and prints the id"""
self
line