When I try using in Django the "filter" Method:
dumpData.objects.filter(bid = True)
我有以下例外:
进口错误: 没有名为“贸易”的模块
File "XXXCacheUtil.py", line 141, in loadItems print DumpData.objects.filter(bid = True)
File "XXXsite-packagesdjangodbmodelsmanager.py", line 141, in filter
return self.get_query_set().filter(*args, **kwargs)
File "X:Python27libsite-packagesdjangodbmodelsquery.py", line 550, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "X:Python27libsite-packagesdjangodbmodelsquery.py", line 568, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "X:Python27libsite-packagesdjangodbmodelssqlquery.py", line 1194, in add_q
can_reuse=used_aliases, force_having=force_having)
File "X:Python27libsite-packagesdjangodbmodelssqlquery.py", line 1069, in add_filter
negate=negate, process_extras=process_extras)
File "X:Python27libsite-packagesdjangodbmodelssqlquery.py", line 1248, in setup_joins
field, model, direct, m2m = opts.get_field_by_name(name)
File "X:Python27libsite-packagesdjangodbmodelsoptions.py", line 307, in get_field_by_name
cache = self.init_name_map()
File "X:Python27libsite-packagesdjangodbmodelsoptions.py", line 337, in init_name_map
for f, model in self.get_all_related_m2m_objects_with_model():
File "X:Python27libsite-packagesdjangodbmodelsoptions.py", line 414, in get_all_related_m2m_objects_with_model
cache = self._fill_related_many_to_many_cache()
File "X:Python27libsite-packagesdjangodbmodelsoptions.py", line 428, in _fill_related_many_to_many_cache
for klass in get_models():
File "X:Python27libsite-packagesdjangodbmodelsloading.py", line 167, in get_models
self._populate()
File "X:Python27libsite-packagesdjangodbmodelsloading.py", line 61, in _populate
self.load_app(app_name, True)
File "X:Python27libsite-packagesdjangodbmodelsloading.py", line 76, in load_app
app_module = import_module(app_name)
File "X:Python27libsite-packagesdjangoutilsimportlib.py", line 35, in import_module
__import__(name)
进口错误: 没有名为“贸易”的模块
贸易是我的达詹戈应用治理环境。 under
INSTALLED_APPS = (
(...),
Trades )
DumpData的定义是:
class DumpData(models.Model):
orderId = models.BigIntegerField()
typeId = models.BigIntegerField()
price = models.DecimalField(decimal_places=2,max_digits=20)
bid = models.BooleanField()
issued = models.DateField()
dateDumped = models.DateTimeField()
我只想
dumbData.objects.all()
所有这些工作都很重,因此可能不是一个服务器/银问题。 (因此我可以无一例外地拯救日期)。