lastrowid not found
The insert ID is returned on a `Model.save`. `Database.last_insert_id` takes a cursor _which was used to insert a row_ and returns the ID of the inserted row. By calling `Database.get_cursor`, your asking Peewee to open a _new_ database cursor, which will have no previously executed queries attached to it, and thus it cannot return a last-insert-id. Because this is a mostly undefined behavior, different error cases will happen for each DB-adapter.
 @b1naryth1ef is correct, you would need to use the cursor you executed the `INSERT` with. If you are executing an `INSERT` statement, it will return the last row id automatically, and that can give you some insight into how to do it:

``` python
    def execute(self):
        if self._is_multi_row_insert and self._query is None:
            if not self.database.insert_many:
                last_id = None
                for row in self._rows:
                    last_id = InsertQuery(self.model_class, row).execute()
                return last_id
        return self.database.last_insert_id(self._execute(), self.model_class)
```

How to know the last added row id?

```
    meta = self.table.database
    cur = meta.get_cursor()
    last_insert_id = meta.last_insert_id(cursor=cur, model=Mt_files)
    print(last_insert_id)
```

AttributeError: 'Cursor' object has no attribute 'lastrowid'
