added: field_model() method to Model
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1103 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -120,6 +120,7 @@ public:
|
||||
{
|
||||
field_before();
|
||||
|
||||
// IMPLEMENTME
|
||||
// if( work_mode == MORM_WORK_MODE_MODEL_FIELDS )
|
||||
// {
|
||||
// put_field_name(field_name);
|
||||
@@ -141,6 +142,34 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ModelClass>
|
||||
void field_model(const wchar_t * field_name, ModelClass & field_model, bool insertable = true, bool updatable = true, bool is_primary_key = false)
|
||||
{
|
||||
if( out_stream && can_field_be_generated(insertable, updatable, is_primary_key) )
|
||||
{
|
||||
field_before();
|
||||
|
||||
// IMPLEMENTME
|
||||
// if( work_mode == MORM_WORK_MODE_MODEL_FIELDS )
|
||||
// {
|
||||
// put_field_name(field_name);
|
||||
// }
|
||||
// else
|
||||
// if( work_mode == MORM_WORK_MODE_MODEL_VALUES )
|
||||
// {
|
||||
// put_field_value(field_value);
|
||||
// }
|
||||
// else
|
||||
if( work_mode == MORM_WORK_MODE_MODEL_FIELDS_VALUES )
|
||||
{
|
||||
put_field_name(field_name);
|
||||
put_name_value_separator();
|
||||
generate_from_model(field_model);
|
||||
}
|
||||
|
||||
field_after();
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FieldValue>
|
||||
void field_to_stream(PT::TextStream & stream, const wchar_t * field_name, const FieldValue & field_value, bool insertable = true, bool updatable = true, bool is_primary_key = false)
|
||||
|
Reference in New Issue
Block a user