Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3394816
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:12:55+00:00 2026-05-18T04:12:55+00:00

I have a Pylons app that I’m using SqlAlchemy declarative models for. In order

  • 0

I have a Pylons app that I’m using SqlAlchemy declarative models for. In order to make the code a bit cleaner I add a .query onto the SA Base and inherit all my models from that.

So in my app.model.meta I have

Base = declarative_base()
metadata = Base.metadata
Session = scoped_session(sessionmaker())

Base.query = Session.query_property(Query)

I think inherit this into app.model.mymodel and declare it as a child of meta.Base. This lets me write my queries as

mymodel.query.filter(mymodel.id == 3).all()

The trouble is that pylint is not seeing .query as a valid attribute of my models.

E:102:JobCounter.reset_count: Class 'JobCounter' has no 'query' member

Obviously this error is all over the place since it occurs on any model doing any query. I don’t want to just skip the error because it might point out something down the road on non-orm classes, but I must be missing something for pylint to accept this.

Any hints?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:12:55+00:00Added an answer on May 18, 2026 at 4:12 am

    Best I could find for this is to pass pylint a list of classes to ignore this check on. It’ll still do other checks for these classes, you’ll just have to maintain a list of these somewhere:

    pylint --ignored-classes=MyModel1,MyModel2 myfile.py

    I know it’s not ideal, but there’s something about the way that sqlalchemy sets up the models that confuses pylint. At least with this you still get the check for non-orm classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Pylons app that I'm trying to set up using Apache and
I have a Python 2.6 web app built on Pylons 0.9.7. The code in
I'm writing a web-app using Python and Pylons. I need a textbox that is
I'm using the SQLAlchemy Python ORM in a Pylons project. I have a class
Newbie question. Pylons 1 + SQLA using declarative style. New to Python. I have
I have a python process (Pylons webapp) that is constantly using 10-30% of CPU.
I have a Pylons application using SQLAlchemy with SQLite as backend. I would like
I have a Pylons app that I am ready to deploy for the first
I have a simple form in python + pylons that submits to a controller.
I have a Pyramid app that I've been developing and viewing locally through http://localhost:6543

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.