mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.7.x] Limited lines to 119 characters in django/{contrib,db}.
Refs #23395.
Backport of c9178ef17a (to decrease chance of backport conflicts) from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							9766ed6a0e
						
					
				
				
					commit
					d73c7e5db6
				
			| @@ -155,10 +155,12 @@ class MigrationWriter(object): | ||||
|         imports.discard("from django.db import models") | ||||
|         items["imports"] = "\n".join(imports) + "\n" if imports else "" | ||||
|         if migration_imports: | ||||
|             items["imports"] += "\n\n# Functions from the following migrations need manual copying.\n# Move them and any dependencies into this file, then update the\n# RunPython operations to refer to the local versions:\n# %s" % ( | ||||
|                 "\n# ".join(migration_imports) | ||||
|             ) | ||||
|  | ||||
|             items["imports"] += ( | ||||
|                 "\n\n# Functions from the following migrations need manual " | ||||
|                 "copying.\n# Move them and any dependencies into this file, " | ||||
|                 "then update the\n# RunPython operations to refer to the local " | ||||
|                 "versions:\n# %s" | ||||
|             ) % "\n# ".join(migration_imports) | ||||
|         # If there's a replaces, make a string for it | ||||
|         if self.migration.replaces: | ||||
|             items['replaces_str'] = "\n    replaces = %s\n" % self.serialize(self.migration.replaces)[0] | ||||
| @@ -394,7 +396,11 @@ class MigrationWriter(object): | ||||
|             return "re.compile(%s)" % ', '.join(args), imports | ||||
|         # Uh oh. | ||||
|         else: | ||||
|             raise ValueError("Cannot serialize: %r\nThere are some values Django cannot serialize into migration files.\nFor more, see https://docs.djangoproject.com/en/dev/topics/migrations/#migration-serializing" % value) | ||||
|             raise ValueError( | ||||
|                 "Cannot serialize: %r\nThere are some values Django cannot serialize into " | ||||
|                 "migration files.\nFor more, see https://docs.djangoproject.com/en/dev/" | ||||
|                 "topics/migrations/#migration-serializing" % value | ||||
|             ) | ||||
|  | ||||
|  | ||||
| MIGRATION_TEMPLATE = """\ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user