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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:11:41+00:00 2026-05-31T20:11:41+00:00

I have some objects which will be used in the same manor. This object

  • 0

I have some objects which will be used in the same manor. This object is categorised in predefined types of this object. Each type has properties belonging to this type of the object.
To get this in a model, I had this tables for the model in mind:

  • One table with the types of the object
  • One table with the predefined properties belonging to the type (with a description/help text of the field, is the property requierd, the type of the field and so on)
  • One table with the objects with a relation to the table with its
    properties (the next one in this list)
  • One table with the properties of the objects and it values (refering to the
    predefined properties for its definition)

it does work, but needs some programming to keep things together.

another issue with this solution is the fieldtype of the property, this can be different. So or I’ll use 1 field type (charField) and try to parse it, or I’ll have a table with different value fields with the most used field types (value_integer = models.IntegerField). In this case you get a lot of emtpy fields just to have 1 of the fields filled in per property. Actually I Am looking for some kind of dictionary…

Not sure whether this is the right way to go….any suggestions?

  • 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-31T20:11:42+00:00Added an answer on May 31, 2026 at 8:11 pm

    Django’s way to go is to define one model class per object type, as expected by all Django’s features (admin, forms, external apps …).

    You can define a superclass and use model inheritance, e.g:

    class BaseThing(models.Model):
        # fields/relations for all types of things
    
    class FooThing(BaseThing):
        # fields/relations for things of type "foo"
    
    class BarThing(BaseThing):
        # fields/relations for things of type "bar"
    

    There, you can predefine defaults as usual.

    If you want your user to create their classes in the admin then consider another framework (eZ Publish suits this need for example).

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

Sidebar

Related Questions

I have an XSD file which is used to generate some objects which are
I have some JS code which generates the following object, return { type: some
Assume you have some objects which have several fields they can be compared by:
I have some business objects which use: Web.Configuration.WebConfigurationManager.AppSettings.Item(SomeSetting) Now that I'm breaking those objects
I have a user control which uses objects as inner properties (some code is
I have a list of objects, some of which can be null. I want
I have created data sources from my objects in my project, some of which
I have an ActiveX object which extends some functions. I have a web page
So I have an object which has some fields, doesn't really matter what. I
I have an object which straight forward instance variables. Some are NSString, some are

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.