Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.contrib.auth.models import User
- from Scanner.models import T
- class SubmitD(ModelForm):
- #model form fields here
- class Meta:
- model = T
- fields = ['field1','field2']
- def save(self, request):
- instance = self.cleaned_data
- #other fields
- current_user = request.user
- d.FKtoClient_id = current_user.id
- d.save()
- current_user = request.user
- d.FKtoClient_id = current_user.id
- (1048, "Column 'FKtoUser_id' cannot be null")
Add Comment
Please, Sign In to add comment