management.commands.retransform
Module¶
-
simpleimages.management.commands.retransform.
parse_model_specifier
(specifier)[source]¶ Parses a string that specifies either a model or a field. The string should look like
app.model.[field]
.>>> print parse_model_specifier('tests.TestModel') (<class 'tests.models.TestModel'>, None) >>> print parse_model_specifier('tests.TestModel.image') (<class 'tests.models.TestModel'>, 'image')
Returns: model and (optionally) field name Return type: tuple of Model
and str or None