Friday, September 9, 2011

How to achieve a construction similar to clean_?

Hello,

I'm creating a tool that will automate the downloading, processing and
repackaging of data.

The scripting for each data set is composed of two main parts: a
fairly standard models.py file, and a loaders.py file that will
contain all the instructions on how to turn the raw data into what
gets saved. The plan is for the two to be linked: each loader object
will have a Meta class in which the corresponding model will be
declared.

With respect to the data processing, I already have defined a
process_data() method to handle general tasks. But I also want each
field in the model to have a process_<fieldname>() method (so, for
example, I can contain all processing related to field A to the
process_a() method. How would I go about this?

Given a model, I want to be able to create process_<fieldname>()
methods for each field. I know forms have a similar construction with
their clean_<fieldname>() methods. I've been looking at the relevant
parts of the Django source, but can't seem to find where those get
created. Can someone steer me in the right direction?

Thanks in advance.

~Allan

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate