当我回到路线3模型时,我对如何在createRecord
动作中创建事件感到有点困惑:
return RSVP.hash({
event: this.store.createRecord('event'),
hiws: this.store.findAll('hiw'),
tips: this.store.findAll('tip')
});
Event
是我想创建的内容,但我在each
中hiws
和tips
hbs
中创建event
,因为hiw
tip
1}}有一个<select class="tables__sidebar-select">
{{#each model.tips as |tip|}}
<option class="tables__sidebar-option">{{tip.name}}</option>
{{/each}}
<select>
和一个hiws
......就像这样:
createRecord
与 let hiws = this.get('model.hiws');
let tips = this.get('model.tips');
let notify = this.get('notify');
let event = this.get('store').createRecord('event', {
hiws: hiws,
tips: tips
});
event.save()
相同。
我这样想:
在我的hiw
行动中:
tip
我正在尝试创建一个包含hiw
和tip
所有属性的事件,但选择{{view "select" content=models.tips.names value=models.event.tip}}
和`def variables(self): #This Function gets the initial conditions from the UI
pressure1=self.ui.pressure1.value
pressure2=self.ui.pressure2.value
temp1=self.ui.temp1.value
temp2=self.ui.temp2.value
`
def properties(self): #This Function pulls values from array, when user picks the gas.
if self.ui.gas_2.findText('Oxygen'):
rc=elementsMap['Oxygen'][1]
gamma=elementsMap['Oxygen'][0]
elif self.ui.gas_2.findText('Helium'):
rc=elementsMap['Helium'][1]
gamma=elementsMap['Helium'][0]
elif self.ui.gas_2.findText('Hydrogen'):
rc=elementsMap['Hydrogen'][1]
gamma=elementsMap['Hydrogen'][0]
def instanous(self): # This function calculates the instanous density.
rho2=self.variables(pressure2)/(self.properties(rc)*self.variables(temp2))
NameError: name 'pressure2' is not defined
。
编辑:
现在,我正在尝试:
val massData1 = [map(float,i) for i in massData]
但没有成功。