Maybe add type as a const on ActivityLog?

```python
class AcitivtyLog(BaseModel):
    QUERY_EXECUTION = 1

[...]

models.ActivityLog.create(user=self.current_user,
    type=models.Activity.QUERY_EXECUTION,
    activity=params['query'])
```