notice how every application constant has a [`pk`](https://github.com/mozilla/zamboni/blob/master/apps/constants/applications.py#L15)? that refers to the unique `pk` in the database for an `Application` object.

that means you could do things [even more simply](https://github.com/mozilla/zamboni/blob/master/apps/constants/applications.py#L193):

```python
if application not in amo.APPS:
    raise CommandError('Application %r does not exist.' % application)
AppVersion.objects.create(application_id=amo.APPS[application].id, version=version)
```