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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:23:39+00:00 2026-06-01T01:23:39+00:00

I use my_classalias = pyamf.register_class(mymodel, mymodel._meta.object_name) to make my django model into AMF serialized

  • 0

I use

my_classalias = pyamf.register_class(mymodel, mymodel._meta.object_name)

to make my django model into AMF serialized objects.

But the problem is mymodel contains a auto created pk field called id, but the Flash/Flex client can’t accept such field, is there a way to remove that in PyAMF ClassAlias?

Thanks in advance!

  • 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-01T01:23:41+00:00Added an answer on June 1, 2026 at 1:23 am

    Here is my own solution:

    m = my_model
    ka = pyamf.register_class(m, m._meta.object_name)
    ka.exclude_attrs = ['field1', 'field2']
    

    or alternatively, in your models.py

    class my_model(models.Model):
        field1 = IntegerField()
        field2 = TextField()
        class __amf__:
            exclude = ('field1', )
    

    Note there is a unpatched bug in PyAMF for the m2m fields, you may have to manually edit file pyamf/adapters/_django_db_models_base.py, line 168:

    for name, relation in self.relations.iteritems():
    
        if name in self.exclude_attrs:
            continue
        if '_%s_cache' % name in obj.__dict__:
            attrs[name] = getattr(obj, name)
    

    Hope this helps someone who has the same problem with me.

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

Sidebar

Related Questions

I want to use my own existing model in GWT application. From what I've
I use my epoch as Datetime myepoch=new DateTime(2005,11,11,7,0,0); But I'd like it to be
I want symfony to use my own sfConfigCache.class.php, but I don't know how to
I use my Google Account for logging into OpenID-enabled websites. In my website, I
I am trying to use my model in razor view and I am getting
I use my remote MySQL database during long time. But today I suddenly have
I use a .htaccess file to rewrite my urls to make them SEO friendly,
I would like to use my website on mechanical turk. But because I can
I'd like to use my program this way: pythonScript -f filename But if I
I use my mobile phone for connection to the internet on my laptop, I

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.