Guest User

Untitled

a guest
Dec 14th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. class ProductsForm(forms.Form):
  2. def __init__(self, *args, **kwargs):
  3. self.request = kwargs.pop('request', None)
  4. super(ProductsForm, self).__init__(*args, **kwargs)
  5. def list_prod(self):
  6. user_name = (self.request).user.username
  7. u = User.objects.get(username=user_name).accesslevel.prod.split(',')
  8. v=(('---------','---------'),)
  9. for l in u:
  10. v=v+((l.lstrip(),l.lstrip()),)
  11. model = Factory
  12. Lists = forms.ChoiceField(choices=list_prod())
Add Comment
Please, Sign In to add comment