本文整理汇总了C++中QDjangoQuerySet::all方法的典型用法代码示例。如果您正苦于以下问题:C++ QDjangoQuerySet::all方法的具体用法?C++ QDjangoQuerySet::all怎么用?C++ QDjangoQuerySet::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDjangoQuerySet
的用法示例。
在下文中一共展示了QDjangoQuerySet::all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_ModelAPIs_lastSchedule
void TestModels::test_ModelAPIs_lastSchedule()
{
const QDjangoQuerySet<Schedule> schedule_set;
QList< QMap<QString, QVariant> > schedule_map = schedule_set.all().values();
QCOMPARE(schedule_map.last(), ModelAPIs::Instance()->lastSchedule());
}
示例2: test_common
void TestModels::test_common()
{
const QDjangoQuerySet<Unit> units;
QList< QMap<QString, QVariant> > unit_map = units.all().values();
//QCOMPARE(unit_map.size(), 4); //See initdb()
const QDjangoQuerySet<Element> elements;
QList< QMap<QString, QVariant> > element_map = elements.all().values();
QCOMPARE(element_map.size(), 3);
const QDjangoQuerySet<Group> groups;
QList< QMap<QString, QVariant> > group_map = groups.all().values();
QCOMPARE(group_map.size(), 2);
const QDjangoQuerySet<ElementGroup> elementgroups;
QList< QMap<QString, QVariant> > elementgroup_map = elementgroups.all().values();
QCOMPARE(elementgroup_map.size(), 1);
const QDjangoQuerySet<Schedule> schedules;
QList< QMap<QString, QVariant> > schedule_map = schedules.all().values();
QCOMPARE(schedule_map.size(), 7);
const QDjangoQuerySet<Record> records;
QList< QMap<QString, QVariant> > record_map = records.all(). values();
QCOMPARE(record_map.size(), 1);
}
示例3: test_ModelAPIs_groups
void TestModels::test_ModelAPIs_groups()
{
const QDjangoQuerySet<Group> groups_set;
QList< QMap<QString, QVariant> > groups_map = groups_set.all().values();
QList<QString> result;
for (int i = 0; i < groups_map.count(); i++){
result << groups_map[i]["name"].toString();
}
QList<QString> result2;
result2 = ModelAPIs::Instance()->groups();
QCOMPARE(result, result2);
}
示例4: test_ModelAPIs_elements
void TestModels::test_ModelAPIs_elements()
{
const QDjangoQuerySet<Element> elements_set;
QList< QMap<QString, QVariant> > elements_map = elements_set.all().values();
//qDebug() << elements_map;
QList<QString> result;
for (int i = 0; i < elements_map.count(); i++){
result << elements_map[i]["name"].toString();
}
QList<QString> result2;
result2 = ModelAPIs::Instance()->elements();
QCOMPARE(result, result2);
}
示例5: test_ModelAPIs_units
void TestModels::test_ModelAPIs_units()
{
// Our result
const QDjangoQuerySet<Unit> units_set;
QList< QList<QVariant> > units = units_set.all().valuesList();
QList<QString> result;
for (int i = 0; i < units.count(); i++){
result << units[i][1].toString();
}
// From method
QList<QString> result2;
result2 = ModelAPIs::Instance()->units();
QCOMPARE(result, result2);
}
示例6: test_ModelAPIs_schedules
/// ModelAPIs
void TestModels::test_ModelAPIs_schedules()
{
const QDjangoQuerySet<Schedule> schedules_set;
QList< QMap<QString, QVariant> > schedule_map = schedules_set.all().values();
QVariantList schedules;
schedules = ModelAPIs::Instance()->schedulesToQVariantList();
//qDebug() << schedules;
QVERIFY(schedule_map.count() == schedules.count());
// If element_id is null then group_id is the title.
QVERIFY(schedules[0].toMap()["title"].toString() == "pushup"); // element title
QVERIFY(schedules[1].toMap()["title"].toString() == "daily"); // group title
//qDebug() << schedule_map;
}