some work in morm
now in Model we have field() methods for other Model or std::list<Model> (code not tested) git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1118 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -117,28 +117,17 @@ public:
|
||||
}
|
||||
|
||||
template<typename ModelClass>
|
||||
void field_list(const wchar_t * field_name, const std::list<ModelClass> & field_value, bool insertable = true, bool updatable = true, bool is_primary_key = false)
|
||||
void field_list(const wchar_t * field_name, const std::list<ModelClass> & field_value, bool insertable, bool updatable, bool is_primary_key, int model_connector_mode)
|
||||
{
|
||||
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();
|
||||
put_field_value_list(field_value);
|
||||
put_field_value_list(field_value, model_connector_mode);
|
||||
}
|
||||
|
||||
field_after();
|
||||
@@ -205,11 +194,13 @@ public:
|
||||
virtual void esc(float val, PT::TextStream & stream);
|
||||
virtual void esc(double val, PT::TextStream & stream);
|
||||
virtual void esc(long double val, PT::TextStream & stream);
|
||||
virtual void esc(void* val, PT::TextStream & stream);
|
||||
//virtual void esc(void* val, PT::TextStream & stream);
|
||||
|
||||
virtual void esc(const PT::Date & date, PT::TextStream & stream);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
int work_mode; /* what to do: generating fields list, values list or fields-values list */
|
||||
@@ -260,7 +251,7 @@ protected:
|
||||
|
||||
|
||||
template<typename ModelClass>
|
||||
void put_field_value_list(const std::list<ModelClass> & field_value)
|
||||
void put_field_value_list(const std::list<ModelClass> & field_value, int model_connector_mode)
|
||||
{
|
||||
if( out_stream )
|
||||
{
|
||||
@@ -280,7 +271,10 @@ protected:
|
||||
}
|
||||
|
||||
//before_field_value(field_value);
|
||||
// FIX ME what about setting model connector to the m? !!!!!!!!!!!!
|
||||
m.model_connector_mode = model_connector_mode;
|
||||
generate_from_model(m);
|
||||
m.model_connector_mode = MORM_MODEL_CONNECTOR_MODE_NONE;
|
||||
//after_field_value(field_value);
|
||||
is_first = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user