Found in views/definition.py

```python
    results = request.db.get_data(model_name)
    for result in results:
        request.db.db.delete(result.value)

    result = request.db.get_definition(model_name)
    request.db.db.delete(result)
```

I've just avoided access to internal db