Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uliweb doesn't support oracle VARCHAR2 #88

Open
zhangchunlin opened this issue Sep 21, 2018 · 0 comments
Open

Uliweb doesn't support oracle VARCHAR2 #88

zhangchunlin opened this issue Sep 21, 2018 · 0 comments

Comments

@zhangchunlin
Copy link
Contributor

zhangchunlin commented Sep 21, 2018

I use "uliweb reflectdb" on a oracle db, the file generate have this line:

from sqlalchemy.dialects.oracle import VARCHAR2

which is inserted by this source code: https://github.com/limodou/uliweb/blob/master/uliweb/contrib/orm/commands.py#L1237

But when I run "uliweb sql", it output error:

  File "/home/zhangclb/oss/uliweb/uliweb/orm/__init__.py", line 4456, in bind
    c = f.create(cls)
  File "/home/zhangclb/oss/uliweb/uliweb/orm/__init__.py", line 1659, in create
    f_type = self._create_type()
  File "/home/zhangclb/oss/uliweb/uliweb/orm/__init__.py", line 1878, in _create_type
    f_type = self.type_class(self.max_length, convert_unicode=True, **self.type_attrs)
TypeError: 'str' object is not callable

And I try to print self.type_class, it is "VARCHAR2"

at last I found the source code generated by reflectdb is like that:

    job_name = Field(str, max_length=250, nullable=False, index=True, type_class='VARCHAR2')

After modify to type_class=VARCHAR2 , it became OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant