Hi All,

I have an admin panel built on Django 2.0.6, MySql 5.7 and Python 3.6.

In this panel I have a field 'PIN' described in models.py like below-
class MerchantStores(models.Model):
    store_id = models.AutoField(primary_key=True)
    pin = models.CharField(unique=True, max_length=45, blank=True, 
null=True)

Currently admin has to fill manually this Pin.

Now, I have to change this PIN text box to a button and on click of this 
button a post request will be sent to an api.
This button will be enabled once admin will edit the form (since Pin 
generation required store id and a store id will be generated only after 
first creating a new store)

The end point of this api will contain the store_id at the end and will 
have some required input parameters like api id etc.

Since this api itself saves the new Pin in database , so I don't need to 
save this field myself. I just need to show a button and on click this 
button make a call to api.

So for this requirement I am going to use Django Rest Framework but before 
that I need your suggestion to implement it with a better way.
Please suggest me how can I make a button field instead of text,then  how 
can I append the store_id to the end point and post my request to the api 
successfully?

Thanks,
Prateek Gupta

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16480a91-3284-44e7-8e6f-7492b4fb8c73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to