def staff_products_form_factory(user):
products = inventory.Product.objects.all()<EOL>products = ProductController.available_products(user, products=products)<EOL>product_ids = [product.id for product in products]<EOL>product_set = inventory.Product.objects.filter(id__in=product_ids)<EOL>class StaffProductsForm(forms.Form):<EOL><INDENT>'''<STR_LIT>'''<EOL>product = forms.ModelChoiceField(<EOL>widget=forms.Select,<EOL>queryset=product_set,<EOL>)<EOL>quantity = forms.IntegerField(<EOL>min_value=<NUM_LIT:0>,<EOL>)<EOL><DEDENT>return StaffProductsForm<EOL>
Creates a StaffProductsForm that restricts the available products to
    those that are available to a user.