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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:31:43+00:00 2026-05-25T02:31:43+00:00

I need to build a generic django object having dynamic parameters. that is parameters

  • 0

I need to build a generic django object having dynamic parameters. that is parameters that can be different from one object to another. I cannot create different models because parameters can change at any time and I do not want to use a PickledField because SQL database should be accessed outside python.

I made these models :

class DynamicObject(models.Model):
    uuid = UUIDField(primary_key=True, editable=False)
    synopsis = models.CharField(max_length=64)
    created = models.DateTimeField(auto_now_add=True)
    modified = models.DateTimeField(auto_now=True)

class DynamicObjectParam(models.Model):
    obj = models.ForeignKey(DynamicObject,related_name='params')
    name = models.CharField(max_length=30)
    value = models.CharField(max_length=255)


To list parameters for a particular object, I do :
obj = DynamicObject.objects.get(uuid='xxx')
for p in obj.params:
    print p.name,p.value

It is quite easy,
but how can I do to select objects having a specific parameter, for exemple :
what are DynamicObjects having a parameter named ‘server_name’ and a value ‘Sun SF25K’ ?

  • 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-25T02:31:43+00:00Added an answer on May 25, 2026 at 2:31 am

    Give this a try:

    results = DynamicObject.objects.filter(params__name__exact='server_name',params__value__exact='Sun SF25K')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to build a generic class that I can use to implement
I need to build something that starts serving a H.264 encoded video to a
I need to build a function which parses the domain from a URL. So,
as part of our application i need to build component that will output code
I have a generic dispatcher that takes in parameters and then make $.ajax() As
I need to build a comma-delimited string from an array. For i=0 to ubound(arr)
I need to build a proxy (maybe a bad description) that receives an XML
I have an ArrayList of objects that I need to sort in two different
I'm triyng to create a generic phing script that will build a joomla plugin.
I need to build a simple, single user database application for Windows. Main requirements

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.