﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22588	makemigrations and regexvalidators	leftmoose	nobody	"comparing `RegexValidator`s doesn't quite work as expected, since it compares compiled instances

not sure why `manage.py makemigrations` still works (maybe re cache?), but the issue arises if e.g. using `call_command(makemigrations)`

{{{
cat app/models.py
from django.core import validators
from django.db import models


# Create your models here.
class MyModel(models.Model):
    field = models.CharField(
        max_length=1,
        validators=[validators.RegexValidator('[A-Za-z]')],
    )
}}}

(single shell session, no changes in the background)

{{{
In [1]: from django.core.management import call_command

In [2]: call_command('makemigrations')
Migrations for 'app':
  0001_initial.py:
    - Create model MyModel

In [3]: call_command('makemigrations')
Migrations for 'app':
  0002_auto_20140506_2031.py:
    - Alter field field on mymodel

In [4]: call_command('makemigrations')
Migrations for 'app':
  0003_auto_20140506_2032.py:
    - Alter field field on mymodel

In [5]: call_command('makemigrations')
Migrations for 'app':
  0004_auto_20140506_2032.py:
    - Alter field field on mymodel
}}}"	Bug	closed	Core (Other)	1.7-beta-2	Release blocker	fixed			Ready for checkin	1	0	0	0	0	0
