dkoug Blog

Pass initial data to form class in django

Django -- Posted on Sept. 8, 2018

Pass initial data to form class in django

1
2
3
4
5
6
def get_initial(self):
    if self.request.GET:
        initial = self.request.GET.dict()
        return initial
    else:
        return super().get_initial()