~ubuntu-branches/ubuntu/quantal/glom/quantal

« back to all changes in this revision

Viewing changes to glom/libglom/python_embed/py_glom_relatedrecord.cc

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2009-01-11 17:12:01 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090111171201-0ov9zh1fxfueshxc
Tags: 1.8.5-0ubuntu1
* New upstream release (LP: #256701), fixes LP bugs: 
  + Clear the text in property dialogs for text items (LP: #309147)
  + Don't crash when showing and then hiding the grid (LP: #303453)
  + Temporarily remember the sort order so it is the same when navigating 
    away and back (LP: #303422)
  + Use the list's sort order for the top-level records in the report 
    (LP: #303425)
  + Users/Groups: Disable drag-and-drop for the treeview, because it is
    useless and confusing (LP: #299573)
  + Import: Sort the fields list alphabetically (LP: #306593)
  + delete primary key make unusuable the database (LP: #299549)
  + Spanish translate incomplete (LP: #299556)
  + import date format error (LP: #299591)
  + can't delete data from table list view (LP: #299853)
  + Field definition: default value not saved (LP: #299896)
  + reports crashing (LP: #300054)
  + Year error with date fields (LP: #300057)
  + list view: 2 records added instead of 1 (LP: #300819)
* debian/control: Refreshed dependencies for libglom-dev.
* debian/control: Updated build-deps to match configure checks. goocavnasmm
  build-dep bumped to version without .la files.
* debian/rules: Don't delete the directory containing the templates.
* debian/control, debian/rules, debian/glom-doc.*: Split out
  arch-independent manual and examples into separate package glom-doc, which
  is now recommended by glom (glom will still work if they're not available)
* debian/copyright: Rewritten to new machine-readable format. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
 
187
187
        //Check whether the field exists in the table.
188
188
        //TODO_Performance: Do this without the useless Field information?
189
 
        sharedptr<Field> field  = self_derived->m_document->get_field((*(self_derived->m_relationship))->get_to_table(), field_name);
 
189
        sharedptr<Field> field = self_derived->m_document->get_field((*(self_derived->m_relationship))->get_to_table(), field_name);
190
190
        if(!field)
191
191
          g_warning("RelatedRecord_tp_as_mapping_getitem: field %s not found in table %s", field_name.c_str(), (*(self_derived->m_relationship))->get_to_table().c_str());
192
192
        else
220
220
            {
221
221
              try
222
222
              {
223
 
                std::cout << "Debug: query_execute():  " << sql_query << std::endl;
 
223
                std::cout << "Debug: RelatedRecord_tp_as_mapping_getitem():  " << sql_query << std::endl;
224
224
              }
225
225
              catch(const Glib::Exception& ex)
226
226
              {
284
284
static PyObject *
285
285
RelatedRecord_generic_aggregate(PyGlomRelatedRecord* self, PyObject *args, PyObject *kwargs, const Glib::ustring& aggregate)
286
286
{
287
 
  static char *kwlist[] = { "field_name", 0 };
 
287
  typedef const char* type_pch;
 
288
  static type_pch kwlist[] = { "field_name", 0 };
288
289
  PyObject* py_field_name = 0;
289
290
 
290
 
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:RelatedRecord.sum", kwlist, &py_field_name))
 
291
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char*)"O:RelatedRecord.sum", (char**)kwlist, &py_field_name))
291
292
    return NULL;
292
293
 
293
294
  if(!(PyString_Check(py_field_name)))
394
395
}
395
396
 
396
397
static PyMethodDef RelatedRecord_methods[] = {
397
 
    {"sum", (PyCFunction)RelatedRecord_sum, METH_VARARGS | METH_KEYWORDS,
398
 
     "Add all values of the field in the related records."
399
 
    },
400
 
    {"count", (PyCFunction)RelatedRecord_count, METH_VARARGS | METH_KEYWORDS,
401
 
     "Count all values in the field in the related records."
402
 
    },
403
 
    {"min", (PyCFunction)RelatedRecord_min, METH_VARARGS | METH_KEYWORDS,
404
 
     "Minimum of all values of the field in the related records."
405
 
    },
406
 
    {"max", (PyCFunction)RelatedRecord_max, METH_VARARGS | METH_KEYWORDS,
407
 
     "Maximum of all values of the field in the related records."
 
398
    {(char*)"sum", (PyCFunction)RelatedRecord_sum, METH_VARARGS | METH_KEYWORDS,
 
399
     (char*)"Add all values of the field in the related records."
 
400
    },
 
401
    {(char*)"count", (PyCFunction)RelatedRecord_count, METH_VARARGS | METH_KEYWORDS,
 
402
     (char*)"Count all values in the field in the related records."
 
403
    },
 
404
    {(char*)"min", (PyCFunction)RelatedRecord_min, METH_VARARGS | METH_KEYWORDS,
 
405
     (char*)"Minimum of all values of the field in the related records."
 
406
    },
 
407
    {(char*)"max", (PyCFunction)RelatedRecord_max, METH_VARARGS | METH_KEYWORDS,
 
408
     (char*)"Maximum of all values of the field in the related records."
408
409
    },
409
410
    {NULL, 0, 0, 0}  /* Sentinel */
410
411
};
415
416
static PyTypeObject pyglom_RelatedRecordType = {
416
417
    PyObject_HEAD_INIT(NULL)
417
418
    0,                         /*ob_size*/
418
 
    "glom.RelatedRecord",             /*tp_name*/
 
419
    (char*)"glom.RelatedRecord",             /*tp_name*/
419
420
    sizeof(PyGlomRelatedRecord), /*tp_basicsize*/
420
421
    0,                         /*tp_itemsize*/
421
422
    (destructor)RelatedRecord_dealloc, /*tp_dealloc*/
434
435
    0,                         /*tp_setattro*/
435
436
    0,                         /*tp_as_buffer*/
436
437
    Py_TPFLAGS_DEFAULT,        /*tp_flags*/
437
 
    "Glom objects",           /* tp_doc */
 
438
    (char*)"Glom objects",           /* tp_doc */
438
439
    0,                  /* tp_traverse */
439
440
    0,                   /* tp_clear */
440
441
    0,                   /* tp_richcompare */