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

  • SEARCH
  • Home
  • 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 8407045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:16:34+00:00 2026-06-09T23:16:34+00:00

I am trying two join to Class args together to make another one. The

  • 0

I am trying two join to Class args together to make another one. The code below outputs the Name property as a tuple instead of a string.

# Person
class Person(ParentClass):
    def __init__(self,
            Collection = 'People',
            Firstname = '',
            Lastname = '',
            Name = '',
            **kwargs):
        self.Collection = Collection
        self.Firstname = Firstname
        self.Lastname = Lastname
        self.Name = '%s %s' % (self.Firstname, self.Lastname),
        self.__dict__.update(kwargs)

p = Person(Firstname='Foo',Lastname='Bar')  ## tuple, not string

p.Name = ('Foo', 'Bar')

The reason I am trying to join the first and last names in the __init__ as opposed to just a property is because the __init__ is tied to an inherited save_to_database method. I want the Name property to be save to the db, but as a string, NOT as a tuple.

Any clues would be fantastic!

  • 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-09T23:16:35+00:00Added an answer on June 9, 2026 at 11:16 pm

    Remove the trailing comma. Turn this…

    self.Name = '%s %s' % (self.Firstname, self.Lastname),
    

    into this:

    self.Name = '%s %s' % (self.Firstname, self.Lastname)
    

    (You’re effectively doing self.Name = 'foo', instead of self.Name = 'foo', and 'foo', is a single-element tuple with the only element being a string, whereas 'foo' is just a string.)

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

Sidebar

Related Questions

Another NHibernate JOIN problem. I'm trying to join two different properties from one table
I am trying to join two tables together using C# linq to entities. One
I'm trying to join two associative arrays together based on an entry_id key. Both
I have two relatively complex queries that I am trying to join together into
im just trying to make a join from two entities. the two entieties are
I'm trying to join two datatables of same keyfields. table1 ID Class ---- -----
I'm trying to make this many-to-many join work with Flask-SQLAlchemy and two MySQL databases,
I am trying to join two tables; the purpose being able to search and
Hi I am trying to join two bits of information on an MVC view
I have been trying to join two tables (USERS AND USERS_ROLES) based on their

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.