S
S
sortfact3332020-11-16 17:35:05
Django
sortfact333, 2020-11-16 17:35:05

How to pass a search by X through a function?

I want to pass through function
Search by specific parameter

def get(object,params,value):
  return obj.objects.get(params = value)
get(Article,title,'Name')

How can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-16
@sortfact333

**{params: value}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question