0

models.py:

class VideoLibrary(models.Model):
    shop_id = models.AutoField(primary_key=True, unique=True)
    shop_name = models.CharField(max_length=264)
    adress = models.TextField(max_length=264, default='')

I have here shop_name and address. The thing I need is to click a button which gets shop_name from text area and match it with address. Is there any way to do it?

enter image description here

as I mentioned I need to get the name of shop from text area and then show its address.

1 Answer 1

1

you can simply validate in your form POST view

if request.POST.get('shop_name') == request.POST.get('adress'):
    # your code when matched
else
    # throw error
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.