Let's say I have the following model
class Plasmid (models.Model):
name = models.CharField("name", max_length=255, unique=True, blank=False)
map = models.FileField("plasmid map")
formz_elements = models.ManyToManyField(FormZBaseElement)
and a function called get_plasmid_map_features
, which takes a Plasmid.map
, analyzes it, and returns a list of formz_elements
.
I'd like to implement a custom button in the admin Plasmid
form (e.g. "Click here to get plasmid features"), which would populate the formz_elements
field WITHOUT having to hit Save
(I can accomplish this upon form submission easily!), while leaving the values of all other fields untouched (i.e. I only want to change the formz_elements
field).
Any suggestions?
Thanks in advance.