Re: Storing regex raw string literal in Django model?

2011-10-14 Thread Daniel Roseman
On Thursday, 13 October 2011 23:58:00 UTC+1, Victor Hooi wrote: > > Hi, > > I have Django model and in one of the fields I need to store a regex string > that I can later use. > > class Foo(models.Model): > name = models.CharField(max_length=30, unique=True) > regex_string = models.TextFie

Storing regex raw string literal in Django model?

2011-10-13 Thread Victor Hooi
Hi, I have Django model and in one of the fields I need to store a regex string that I can later use. class Foo(models.Model): name = models.CharField(max_length=30, unique=True) regex_string = models.TextField() So for example, the regex_string field might be set to: r'\d{2}' I the