Framework design question

  • Thread starter Alan Harris-Reid
  • Start date
A

Alan Harris-Reid

Hi,

When committing data that has originally come from a webpage, sometimes
data has to be converted to a data type or format which is suitable for
the back-end database. For instance, a date in 'dd/mm/yyyy' format
needs to be converted to a Python date-object or 'yyyy-mm-dd' in order
to be stored in a SQLite date column (SQLite will accept 'dd/mm/yy', but
that can cause problems when data is retrieved).

Question - at what point should the data be converted?
a) As part of a generic web_page_save() method (immediately after
data validation, but before a row.table_update() method is called).
b) As part of row.table_update() (a data-object method called from
web- or non-web-based applications, and includes construction of a
field-value parameter list prior to executing the UPDATE command).

In other words, from a framework point-of-view, does the data-conversion
belong to page-object processing or data-object processing?

Any opinions would be appreciated.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top