I am trying to join two files, the doctor file linked to doctor_speciality
file. this a listing of the doctor_speciality.py and the attempt to run
this appWizard med.py with the error
self.addJoin("doctor", "doctor_speciality.specialityfk =doctor.pkid")
NameError: name 'self' is not defined
======================================================
# -*- coding: utf-8 -*-
from Base import Base
class Doctor_Speciality(Base):
def initProperties(self):
self.super()
self.Caption = "Doctor_Speciality"
self.DataSource = "doctor_speciality"
self.KeyField = "pkid"
# Setting the DataStructure explicitly here is optional, but
recommended
as
# it will keep Dabo from interpreting field types from the
backend every
# time. It lets you specify what types you expect which fields
to be.
Also,
# this information is used in self.setSQL() to add the fields
to the
query.
# (field_alias, field_type, pk, table_name, field_name,
field_scale)
self.DataStructure = (
("pkid", "I", True, "doctor_speciality",
"pkid"),
("title", "C", False, "doctor_speciality",
"title"),
)
# Use the DefaultValues dict to specify default field values
for new
# records. By default DefaultValues is the empty dict, meaning
that
# no default values will be filled in.
#self.DefaultValues['<field_name>'] = <value_or_function_object>
# Default encoding is set to utf8, but if your backend db
encodes in
# something else, you need to set that encoding here (or in
each
# bizobj individually. A very common encoding for the Americas
and
# Western Europe is "latin-1", so if you are getting errors but
are
# unsure what encoding to pick, try uncommenting the following
line:
#self.Encoding = "latin-1"
def afterInit(self):
self.super()
def setBaseSQL(self):
# Set up the base SQL (the fields clause, the from clause,
etc.) The
# UI refresh() will probably modify the where clause and maybe
the
# limit clause, depending on what the runtime user chooses in
the
# select page.
self.addFrom("doctor_speciality")
self.setLimitClause("500")
self.addFieldsFromDataStructure()
self.addJoin("doctor", "doctor_speciality.specialityfk
=doctor.pkid")
================================================
C:\dabo-0.9.2-win\dabo\projects\med>python med.py
Traceback (most recent call last):
File "med.py", line 21, in <module>
import biz
File "C:\dabo-0.9.2-win\dabo\projects\med\biz\__init__.py", line 8, in
<module
>
from Doctor_Speciality import Doctor_Speciality
File "C:\dabo-0.9.2-win\dabo\projects\med\biz\Doctor_Speciality.py", line
6, i
n <module>
class Doctor_Speciality(Base):
File "C:\dabo-0.9.2-win\dabo\projects\med\biz\Doctor_Speciality.py", line
49,
in Doctor_Speciality
self.addJoin("doctor", "doctor_speciality.specialityfk =doctor.pkid")
NameError: name 'self' is not defined
C:\dabo-0.9.2-win\dabo\projects\med>
--
View this message in context:
http://old.nabble.com/join-two-files-in-appWizard-tp26662306p26662306.html
Sent from the dabo-users mailing list archive at Nabble.com.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]