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 9014201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:27:09+00:00 2026-06-16T03:27:09+00:00

I am using python to get values from one of table using filter .

  • 0

I am using python to get values from one of table using filter .

queryset1 = model_user_profile.UserProfile.filter(user = uid).values('time_zone')

where model_user_table has following columns:

---------------+--------------+------+-----+---------+----------------+
| Field         | Type         | Null | Key | Default | Extra          |
+---------------+--------------+------+-----+---------+----------------+
| id            | int(11)      | NO   | PRI | NULL    | auto_increment |
| user_id       | int(11)      | NO   | UNI | NULL    |                |
| time_zone     | varchar(128) | YES  |     | NULL    |                |
+---------------+--------------+------+-----+---------+----------------+

value of uid and user_id in above query and table respectively are 1 and 1 , but still query fails and error: AttributeError: type object 'UserProfile' has no attribute 'filter' is displayed.

I am using similar queries in past but never received such error , what can be the possible issue????

  • 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-06-16T03:27:11+00:00Added an answer on June 16, 2026 at 3:27 am

    use this:

    filter is like where clause in sql

    obj = your_model.objects.filter( user = uid)
    

    for more info see this docs

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

Sidebar

Related Questions

Is there a way to get one value from a tuple in Python using
In Python, I'm constantly using the following sequence to get an integer value from
Is it possible to get which values are duplicates in a list using python?
I want to get the video stream from my webcam using python and OpenCV,
I am using python and postgresql. I have a table with 6 column. One
Using Python module re, how to get the equivalent of the \w (which matches
How can I get a transparent cursor using Python GTK3 and pyGObject. I have
I'm using Python + ZOPE/ZODB/Repoze BFG (the acronyms all get quite confusing) + paster.
I am using Python's AWeber API (https://github.com/aweber/AWeber-API-Python-Library), and I frequently get these exceptions. I
How to parse the string {'result':(Boolean, MessageString)} using Python regular expressions to get Boolean

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.