def __init__(self, *args, **kwargs):
    super(GalleryForm, self).__init__(*args, **kwargs)
rel = ManyToOneRel(self.instance.photos.model, 'id')
Django admin - How can I add the green plus sign for Many-to-many Field in custom admin form