Skip to content

[ORM] How to query object by a custom field value pattern (regex)? #6478

Answered by drmsoffall
drygdryg asked this question in Q&A
Discussion options

You must be logged in to vote

How about

Device.objects.filter(custom_field_data__backup_location__regex=r'cbackup://\d+')

Probably not the most efficient QuerySet ever but it should work!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jeremystretch
Comment options

@drygdryg
Comment options

Answer selected by drygdryg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants