Permalink
Browse files

Added a method on the manager to do the heavy lifting

  • Loading branch information...
1 parent 90f288e commit d6bb187b79a15e4b9e9569720502ab4cfee85a81 @HonzaKral HonzaKral committed Jun 10, 2009
Showing with 8 additions and 2 deletions.
  1. +4 −2 djangomarkup/management/commands/extract_source_texts.py
  2. +4 −0 djangomarkup/models.py
@@ -2,7 +2,7 @@
from django.db.models import get_model
from django.db.models.fields import FieldDoesNotExist
-from djangomarkup.models import TextProcessor
+from djangomarkup.models import TextProcessor, SourceText
def get_fields_to_extract(fields):
@@ -53,5 +53,7 @@ def handle(self, *args, **options):
if to_extract is None:
return
- print to_extract
+ for model_name, fields in to_extract.items():
+ model = get_model(*model_name.split('.', 1))
+ SourceText.objects.extract_from_model(model, fields)
View
@@ -73,6 +73,10 @@ def delete_for_object(self, instance):
object_id=pk,
).delete()
+ def extract_from_model(self, model, fields):
+ pass
+
+
class SourceText(models.Model):
"""
Source text is plain text with processor-specific formatting inputted by user.

0 comments on commit d6bb187

Please sign in to comment.