I'm trying to match strings with unexpected additional suffix and then select the database in the string.
Example Model:
class Example(models.Model):
name = models.CharField(max_length=100, default='abcdef', unique=True)
Code:
string = 'abcdef'
unexpected_suffix = '_d' # This is random and can be '_e', 'eeee', '321'
_string = '{0}{1}'.format(string, unexpected_suffix) # abcdef_d
x = Example.objects.get(name__randomlookup=_string) # randomlookup is just an example
Then the variable x will SELECT the row with a name value of 'abcdef'. Is it possible to just use purely Django ORM with this?
P.S.
icontains and iregex will not solve the problem