我正在使用Perl来驱动BigQuery,我正在尝试插入一个将从查询结果中填充表的作业。我得到的错误是“缺少必需参数”。那个参数是什么? (如果错误消息更具体,那就太好了)
以下是代码:
$response = $bq->request(
resource => 'jobs',
method => 'insert',
content => {
configuration => {
query => {
query => $query,
destinationTable => {
project_id => $project_id,
dataset_id => $dataset_id,
tableId => $table_id,
},
createDisposition => "CREATE_IF_NEEDED",
writeDisposition => "WRITE_APPEND",
allowLargeResults =>"TRUE",
},
},
},
async => $async,
);
请注意,如果我跳过destinationTable部分,代码工作正常,但它会将结果放在临时表中。所以这有效:
$response = $bq->request(
resource => 'jobs',
method => 'insert',
content => {
configuration => {
query => {
query => $query,
createDisposition => "CREATE_IF_NEEDED",
writeDisposition => "WRITE_APPEND",
},
},
},
async => $async,
);
有什么想法吗?不要因为这是Perl,它的行为与Python相同,只是格式不同。
答案 0 :(得分:3)
尝试:
from django.contrib import admin
from django.forms import TextInput, Textarea
from django.db import models
from coleccion.models import Material,
class MaterialAdmin(admin.ModelAdmin):
list_display = ('num_com', 'identificacion', 'descripcion','ubicacion', 'estado_material')
search_fields = ('num_com', 'identificacion', 'descripcion','ubicacion')
formfield_overrides = {
models.CharField: {'widget': TextInput(attrs={'size':'40'})},
models.TextField: {'widget': Textarea(attrs={'rows':4, 'cols':80})},
}