django populate choice field from database

ChoiceField doesn't have a queryset. You're looking for ModelChoiceField

Here is what the above code is Doing:
1. It’s creating a form with a field named ‘user’ that is a dropdown of all the users in the database.
2. It’s creating a form with a field named ‘group’ that is a dropdown of all the groups in the database.
3. It’s creating a form with a field named ‘permission’ that is a dropdown of all the permissions in the database.
4. It’s creating a form with a field named ‘content_type’ that is a dropdown of all the content types in the database.
5. It’s creating a form with a field named ‘object_id’ that is a text field.
6. It’s creating a form with a field named ‘codename’ that is a text field.
7. It’s creating a form with a submit button.