我在django中创建了一个项目.我使用pyinstaller为它创建了安装程序.如果我使用python manage.py runserver运行项目,那么项目运行正常没有任何错误,但我无法通过安装程序运行它.运行安装程序时出错.
C:\The_Incredibles\Pyinstaller Story\test_proj>.\dist\demo\demo.exe runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper
at 0x03A15978>
Traceback (most recent call last):
File "site-packages\django-1.10.4-py3.5.egg\django\utils\autoreload.py", line
226, in wrapper
File "site-packages\django-1.10.4-py3.5.egg\django\core\management\commands\ru
nserver.py", line 113, in inner_run
File "site-packages\django-1.10.4-py3.5.egg\django\utils\autoreload.py", line
249, in raise_last_exception
File "site-packages\django-1.10.4-py3.5.egg\django\utils\six.py", line 685, in
reraise
File "site-packages\django-1.10.4-py3.5.egg\django\utils\autoreload.py", line
226, in wrapper
File "site-packages\django-1.10.4-py3.5.egg\django\__init__.py", line 27, in s
etup
File "site-packages\django-1.10.4-py3.5.egg\django\apps\registry.py", line 85,
in populate
File "site-packages\django-1.10.4-py3.5.egg\django\apps\config.py", line 116,
in create
File "importlib\__init__.py", line 126, in import_module
File …Run Code Online (Sandbox Code Playgroud) 使用这种语言的新功能,本周开始使用它编写代码.
所以我的问题是我开始使用的新公司使用CF11,他们主要只使用标签编码.我想知道是否可以在cfset没有变量声明的情况下调用.
如果不是用标签调用函数(没有返回)的更好方法是什么?
<cfset myFunction()>
Run Code Online (Sandbox Code Playgroud)
我通常在cfset上调用我的启动函数,但它们都返回了.
<cfset something = #initSomething()#>
Run Code Online (Sandbox Code Playgroud) 我正在尝试从我的组件导入路径,但一个文件夹有多个点,例如board.event.calendar. 由于这是此代码库中的常规结构,因此我无法更改文件夹名称。我尝试了多种方法来实现 CreatObject 参数中的正确路径,例如:
<cfset Event = CreateObject("Component", "path.to.'board.event.calendar'.Event") />
<cfset Event = CreateObject("Component", "path/to/'board.event.calendar'/Event") />
<cfset Event = CreateObject("Component", "path\to\'board.event.calendar'\Event") />
<cfset Event = CreateObject("Component", "path.to.board#chr(046)#event#chr(046)#calendar.Event") />
Run Code Online (Sandbox Code Playgroud)
但到目前为止还没有运气。我该如何处理?
我正在以谷歌更好的形式进行搜索,以便在coldfusion中对"查询"进行交流,因为我在公司工作的新人,我试图从CF获得更多
在这里我的尝试:
我的模特:
<cffunction hint="Foo" name="Foo" access="public" returntype="query">
<!--- Argumentos --->
<cfargument hint="Something" name="ArgComBus" type="string" required="no" default="">
<cfargument hint="Other thing" name="ArgPar" type="string" required="no" default="">
<cfscript>
queryService = new Query();
queryService.setSql("
SELECT
column1,
column2,
FROM
tab_bar
WHERE
1=1
#arguments.ArgComBus#
");
queryService.setDataSource(session.Dsn);
if(Len(Trim(arguments.ArgPar))){
Evaluate(arguments.ArgPar);
}
queryResult = queryService.execute();
qBus = queryResult.getResult();
</cfscript>
<cfreturn qBus>
</cffunction>
Run Code Online (Sandbox Code Playgroud)
我的剧本
<cfscript>
arrFoo = arrayNew(1);
qFoo = this.Foo(
ArgComBus = " AND column1 = #variables.bar# ");
// First Attempt - The each method was not found.
qFoo.each(function …Run Code Online (Sandbox Code Playgroud)