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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:42:33+00:00 2026-06-13T20:42:33+00:00

class Person: first_name = superjson.Property() last_name = superjson.Property() posts = superjson.Collection(Post) class Post: title

  • 0
class Person:
    first_name = superjson.Property()
    last_name = superjson.Property()
    posts = superjson.Collection(Post)

class Post:
    title = superjson.Property()
    description = superjson.Property()

# ^^^ this approach is very similar to Django models/forms

Then, given JSON like this:

{
  "first_name": "John", 
  "last_name": "Smith",
  "posts": [
    {"title": "title #1", "description": "description #1"},
    {"title": "title #2", "description": "description #2"},
    {"title": "title #3", "description": "description #3"}
  ]
}

I want it to build a proper Person object with everything inside it set:

p = superjson.deserialize(json, Person) # note, root type is explicitly provided
print p.first_name # 'John'
print p.last_name # 'Smith'
print p.posts[0].title # 'title #1'
# etc...
  • Sure it should also facilitate serialization
  • It should either serialize/deserialize time to/from ISO-8601 by default or be easy to achieve this in couple lines of code.

So, I’m looking for this superjson. Did anyone see anything similar?

  • 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-13T20:42:34+00:00Added an answer on June 13, 2026 at 8:42 pm

    Colander, combined with limone does exactly this.

    You define a schema using colander:

    import colander
    import limone
    
    
    @limone.content_schema
    class Characteristic(colander.MappingSchema):
        id = colander.SchemaNode(colander.Int(),
                                 validator=colander.Range(0, 9999))
        name = colander.SchemaNode(colander.String())
        rating = colander.SchemaNode(colander.String())        
    
    
    class Characteristics(colander.SequenceSchema):
        characteristic = Characteristic()
    
    
    @limone.content_schema
    class Person(colander.MappingSchema):
        id = colander.SchemaNode(colander.Int(),
                                 validator=colander.Range(0, 9999))
        name = colander.SchemaNode(colander.String())
        phone = colander.SchemaNode(colander.String())
        characteristics = Characteristics()
    
    
    class Data(colander.SequenceSchema):
        person = Person()
    

    then pass in your JSON data structure:

    deserialized = Data().deserialize(json.loads(json_string)) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I typically write something like this: class Person < ActiveRecord::Base attr_accessible :first_name, :last_name def
from django.db import models class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) Is this
I have this models in Django class Country(models.Model): name = models.CharField(max_length=80) class Person(models.Model): first_name
I have a basic model: class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) state
Suppose I have a Django model as follows: class Person(models.Model): first_name = models.CharField(max_length=50) last_name
Here is what I do: class Person(db.Model): first_name = db.StringProperty() last_name = db.StringProperty() middle_name
If I have the following Model: class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30)
I'm using the Code First approach and have the following Model: public class Person
class Person { string name; public Person(string name) { this.name = name; } public
I have created a php person class and a very basic form. The form

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.