My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 7 days

  • Dec 22, 2009
    issue 8 (Encoding Error) commented on by Tofi.Buzali   -   Here is the view code: def complejo(request, id): """Regresa JSON con info del complejo con id""" comp = get_object_or_404(Complejo,pk=id) serializers.serialize("json", [comp], ensure_ascii =False) Here is the traceback: http://dpaste.com/136886/ This is what I get when using the standard serializer: http://dpaste.com/136887/ I hope this is enough, let me know if you need anything else... thanks
    Here is the view code: def complejo(request, id): """Regresa JSON con info del complejo con id""" comp = get_object_or_404(Complejo,pk=id) serializers.serialize("json", [comp], ensure_ascii =False) Here is the traceback: http://dpaste.com/136886/ This is what I get when using the standard serializer: http://dpaste.com/136887/ I hope this is enough, let me know if you need anything else... thanks
  • Dec 22, 2009
    issue 8 (Encoding Error) commented on by mattimustang   -   Can you please provide some sample data?
    Can you please provide some sample data?
  • Dec 22, 2009
    issue 8 (Encoding Error) reported by Tofi.Buzali   -   My data has some non-ASCII characters, when using wadofstuff serializer I get a UnicodeEncodeError 'ordinal not in range(128)' Any ideas how to correct this?? The default serializer does not throw this exception.
    My data has some non-ASCII characters, when using wadofstuff serializer I get a UnicodeEncodeError 'ordinal not in range(128)' Any ideas how to correct this?? The default serializer does not throw this exception.

Last 30 days

  • Nov 30, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by jameskhedley   -   Using this with a pyjamas front end - this has saved me a lot of time! Thank you very much. What I like is that it has just enough flexibility to be useful but not too much that it takes a long time to figure out.
    Using this with a pyjamas front end - this has saved me a lot of time! Thank you very much. What I like is that it has just enough flexibility to be useful but not too much that it takes a long time to figure out.

Earlier this year

  • Nov 24, 2009
    issue 7 (Serializing related models as a proper JSON dump) reported by to...@syneus.fi   -   (Following was built over wadofstuff revision 53 and Django 1.1.1.) Having related models serialized inline within "fields" is nice but I needed the related models outside "fields" i.e. with the main object. Thus one could have the needed hierarchy of models in a form deserializable by regular Django JSON deserializers. In the patch attached I added a keyword 'serialize_inline' keyword to (wadofstuff.django.serializers.base.Serializer.)serialize. When * serialize_inline == True (default), the serializer will function just as regular wadofstuff serializers i.e serializing the defined related models within "fields". * serialize_inline == False, related models will be traversed as before but the serializations will be added to the main dump. An example for teacher -> school foreign key relation: =================================================== serializers.serialize('json', Teacher.objects.all(), relations=('school',)) the regular output will be [ { "pk": 1, "model": "app.teacher", "fields": { ... "school": {"pk": 1, "model": "app.school" ...} }, ... ] but with serializers.serialize('json', Teacher.objects.all(), relations=('school',), serialize_inline=False) the output would be [ { "pk": 1, "model": "app.school", "fields": {...} }, { "pk": 1, "model": "app.teacher", "fields": { ... "school": 1, }, ... ] This can be used straight away by deserializers and thus ease the pain of creating fixtures for example for testing. Some comments: ============== * duplicate removal is done in end_serialization (by comparing ("model", "pk") pairs) * relations work as usual i.e. non-recursively * reverse m2m, fk (and generic relations) won't work yet but I'll post the patch (with reverse m2m and fk) after implementing the work by sturton in http://code.google.com/p/wadofstuff/issues/detail?id=4 Please contact me for comments or suggestions. :)
    (Following was built over wadofstuff revision 53 and Django 1.1.1.) Having related models serialized inline within "fields" is nice but I needed the related models outside "fields" i.e. with the main object. Thus one could have the needed hierarchy of models in a form deserializable by regular Django JSON deserializers. In the patch attached I added a keyword 'serialize_inline' keyword to (wadofstuff.django.serializers.base.Serializer.)serialize. When * serialize_inline == True (default), the serializer will function just as regular wadofstuff serializers i.e serializing the defined related models within "fields". * serialize_inline == False, related models will be traversed as before but the serializations will be added to the main dump. An example for teacher -> school foreign key relation: =================================================== serializers.serialize('json', Teacher.objects.all(), relations=('school',)) the regular output will be [ { "pk": 1, "model": "app.teacher", "fields": { ... "school": {"pk": 1, "model": "app.school" ...} }, ... ] but with serializers.serialize('json', Teacher.objects.all(), relations=('school',), serialize_inline=False) the output would be [ { "pk": 1, "model": "app.school", "fields": {...} }, { "pk": 1, "model": "app.teacher", "fields": { ... "school": 1, }, ... ] This can be used straight away by deserializers and thus ease the pain of creating fixtures for example for testing. Some comments: ============== * duplicate removal is done in end_serialization (by comparing ("model", "pk") pairs) * relations work as usual i.e. non-recursively * reverse m2m, fk (and generic relations) won't work yet but I'll post the patch (with reverse m2m and fk) after implementing the work by sturton in http://code.google.com/p/wadofstuff/issues/detail?id=4 Please contact me for comments or suggestions. :)
  • Nov 17, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by johnvmccollum   -   Great work on the serializer, thank you very, very much!
    Great work on the serializer, thank you very, very much!
  • Nov 13, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by fuzzyman   -   In the extras documentation you say: {{{These properties may be almost any standard python attribute or method.}}} But it seems to me (from experimentation) that they _can't_ be any attribute, they _have_ to be a method that takes no arguments. In addition if this method returns anything other than a string then the object is serialized as a string. I need to serialize a list of dictionaries and this is coming out as a string in the json. This makes me a sad bunny as I then have to serialize it myself. :-(
    In the extras documentation you say: {{{These properties may be almost any standard python attribute or method.}}} But it seems to me (from experimentation) that they _can't_ be any attribute, they _have_ to be a method that takes no arguments. In addition if this method returns anything other than a string then the object is serialized as a string. I need to serialize a list of dictionaries and this is coming out as a string in the json. This makes me a sad bunny as I then have to serialize it myself. :-(
  • Nov 05, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by xaralis93   -   I am having little trouble when trying to serialize a model created by multi-table model inheritance. I have tracked down the source to the fact that django marks the link from model to it's parent (OneToOneField) with serialize=False. This results in not serializing the field by the serializer. I need to serialize the fields from the parent as well. Do you have some hint how to prevent Django from marking it up like this?
    I am having little trouble when trying to serialize a model created by multi-table model inheritance. I have tracked down the source to the fact that django marks the link from model to it's parent (OneToOneField) with serialize=False. This results in not serializing the field by the serializer. I need to serialize the fields from the parent as well. Do you have some hint how to prevent Django from marking it up like this?
  • Oct 14, 2009
    issue 5 (Serialize Class Inheritance) commented on by naranjo.manuel   -   This is another approach of the patch, with subclass support. Subclass works by going through the tree until we reach the real node. It's not an efficient method because you have to hit the database lots of times per object. I prefer doing something like: def getRemoteDeviceIterator(): classes = [ RemoteBluetoothDeviceFoundRecord, RemoteBluetoothDeviceSDP, RemoteBluetoothDeviceNoSDP, RemoteBluetoothDeviceSDPTimeout, RemoteBluetoothDeviceFileTry, RemoteBluetoothDeviceFilesRejected, RemoteBluetoothDeviceFilesSuccess ] a=list() for b in classes: a.append(b.objects.filter(agentdevicerecord__commited=False).all()) for clas in a: for element in clas: yield element because the list(QuerySet..)+list(QuerySet...) hits the database when you do the call and gets you a lot of stuff in memory. This patch also adds all the fields that are serializable not just the local_fields, fields includes the parent class fields so there's no need for doing the weird things from the previous patch. I've tested the patch on lab, and going to do deployment tomorrow. Wanted to let you guys know of it just in case. Keep the good work, Manuel ps: With this patch I'm able to send the subclass and get it deserialized with django serializer on the other end. The only thing I need to make sure is that the ForeignKeys or M2M are there before I call save
    This is another approach of the patch, with subclass support. Subclass works by going through the tree until we reach the real node. It's not an efficient method because you have to hit the database lots of times per object. I prefer doing something like: def getRemoteDeviceIterator(): classes = [ RemoteBluetoothDeviceFoundRecord, RemoteBluetoothDeviceSDP, RemoteBluetoothDeviceNoSDP, RemoteBluetoothDeviceSDPTimeout, RemoteBluetoothDeviceFileTry, RemoteBluetoothDeviceFilesRejected, RemoteBluetoothDeviceFilesSuccess ] a=list() for b in classes: a.append(b.objects.filter(agentdevicerecord__commited=False).all()) for clas in a: for element in clas: yield element because the list(QuerySet..)+list(QuerySet...) hits the database when you do the call and gets you a lot of stuff in memory. This patch also adds all the fields that are serializable not just the local_fields, fields includes the parent class fields so there's no need for doing the weird things from the previous patch. I've tested the patch on lab, and going to do deployment tomorrow. Wanted to let you guys know of it just in case. Keep the good work, Manuel ps: With this patch I'm able to send the subclass and get it deserialized with django serializer on the other end. The only thing I need to make sure is that the ForeignKeys or M2M are there before I call save
  • Oct 12, 2009
    issue 6 (generic_inlines support in create_update.py) reported by cuzido   -   Hello Surfer, Will be great to have generic relation support also in create_update.py from wadofstuff-django.views package. I've made some changes in file (attached), and now i can use it with generic relations: form = { 'model': Band, 'form_class': BandForm, 'generic_inlines':[{ 'form':MailForm, 'model':Mail, 'extra':1, 'max_num':1, 'can_delete':False, }], 'post_save_redirect':'/band/%(id)s/' }
    Hello Surfer, Will be great to have generic relation support also in create_update.py from wadofstuff-django.views package. I've made some changes in file (attached), and now i can use it with generic relations: form = { 'model': Band, 'form_class': BandForm, 'generic_inlines':[{ 'form':MailForm, 'model':Mail, 'extra':1, 'max_num':1, 'can_delete':False, }], 'post_save_redirect':'/band/%(id)s/' }
  • Sep 24, 2009
    WadOfStuffDjangoViews (A set of view functions and classes to extend the functional...) Wiki page commented on by mattimustang   -   Hi, the view functions are for Django not GAE. Feel free to leave some *constructive* comments and/or patches.
    Hi, the view functions are for Django not GAE. Feel free to leave some *constructive* comments and/or patches.
  • Sep 23, 2009
    WadOfStuffDjangoViews (A set of view functions and classes to extend the functional...) Wiki page commented on by rocker.of.beds   -   Still has dependence on DJANGO_SETTINGS_MODULE enviromnet variable. this needs to be fixed
    Still has dependence on DJANGO_SETTINGS_MODULE enviromnet variable. this needs to be fixed
  • Sep 15, 2009
    r53 (Make sure parent class validation such as validate_unique() ...) committed by mattimustang   -   Make sure parent class validation such as validate_unique() is performed.
    Make sure parent class validation such as validate_unique() is performed.
  • Aug 10, 2009
    WadOfStuffDjangoForms (A set of utility functions and classes to extend the functio...) Wiki page edited by mattimustang   -   Revision r52 Added docs for RequireOneFormSet.
    Revision r52 Added docs for RequireOneFormSet.
  • Aug 10, 2009
    r51 (tagging wadofstuff-django-serializer-1.0.0) committed by mattimustang   -   tagging wadofstuff-django-serializer-1.0.0
    tagging wadofstuff-django-serializer-1.0.0
  • Aug 10, 2009
    r50 (tagging wadofstuff-django-views-1.0.1) committed by mattimustang   -   tagging wadofstuff-django-views-1.0.1
    tagging wadofstuff-django-views-1.0.1
  • Aug 10, 2009
    r49 (tagging wadofstuff-django-views-1.0.0) committed by mattimustang   -   tagging wadofstuff-django-views-1.0.0
    tagging wadofstuff-django-views-1.0.0
  • Aug 10, 2009
    r48 (tagging wadofstuff-django-forms-1.1.0) committed by mattimustang   -   tagging wadofstuff-django-forms-1.1.0
    tagging wadofstuff-django-forms-1.1.0
  • Aug 10, 2009
    r47 (tagging wadofstuff-django-forms-1.0.0) committed by mattimustang   -   tagging wadofstuff-django-forms-1.0.0
    tagging wadofstuff-django-forms-1.0.0
  • Aug 10, 2009
    wadofstuff-django-forms-1.1.0.tar.gz (Extended Django forms) file uploaded by mattimustang   -  
    Labels: Featured Type-Source OpSys-All
    Labels: Featured Type-Source OpSys-All
  • Aug 10, 2009
    r46 (- Added RequireOneFormSet inline formset class. - Modified t...) committed by mattimustang   -   - Added RequireOneFormSet inline formset class. - Modified to allow classes and functions to be imported from wadofstuff.django. forms.
    - Added RequireOneFormSet inline formset class. - Modified to allow classes and functions to be imported from wadofstuff.django. forms.
  • Aug 10, 2009
    r45 (allow views to be imported from wadofstuff.django.views.) committed by mattimustang   -   allow views to be imported from wadofstuff.django.views.
    allow views to be imported from wadofstuff.django.views.
  • Aug 10, 2009
    WadOfStuffDjangoViews (A set of view functions and classes to extend the functional...) Wiki page edited by mattimustang   -   Revision r44 Edited wiki page through web user interface.
    Revision r44 Edited wiki page through web user interface.
  • Aug 10, 2009
    wadofstuff-django-views-1.0.1.tar.gz (Inline formset support for Django Generic Views) file uploaded by mattimustang   -  
    Labels: Type-Source Featured OpSys-All
    Labels: Type-Source Featured OpSys-All
  • Aug 10, 2009
    wadofstuff-django-views-1.0.0.tar.gz (Inline formset support for Django Generic Views) file uploaded by mattimustang   -  
    Labels: Featured Type-Source OpSys-All
    Labels: Featured Type-Source OpSys-All
  • Aug 10, 2009
    WadOfStuffDjangoForms (A set of utility functions and classes to extend the functio...) Wiki page edited by mattimustang   -   Revision r43 Edited wiki page through web user interface.
    Revision r43 Edited wiki page through web user interface.
  • Aug 10, 2009
    WadOfStuffDjangoViews (A set of view functions and classes to extend the functional...) Wiki page edited by mattimustang   -   Revision r42 Edited wiki page through web user interface.
    Revision r42 Edited wiki page through web user interface.
  • Aug 10, 2009
    WadOfStuffDjangoViews (A set of view functions and classes to extend the functional...) Wiki page added by mattimustang   -   Revision r41 Created wiki page through web user interface.
    Revision r41 Created wiki page through web user interface.
  • Aug 10, 2009
    WadOfStuffForms Wiki page deleted by mattimustang   -   Revision r40 Deleting wiki page WadOfStuffForms.
    Revision r40 Deleting wiki page WadOfStuffForms.
  • Aug 10, 2009
    WadOfStuffDjangoForms (A set of utility functions and classes to extend the functio...) Wiki page added by mattimustang   -   Revision r39 Created wiki page through web user interface.
    Revision r39 Created wiki page through web user interface.
  • Aug 10, 2009
    WadOfStuffForms (A set of utility functions and classes to extend the functio...) Wiki page added by mattimustang   -   Revision r38 Created wiki page through web user interface.
    Revision r38 Created wiki page through web user interface.
  • Aug 10, 2009
    IPAddressSummarization (Documentation and examples for the Wad of Stuff IP Summariza...) Wiki page edited by mattimustang   -   Revision r37 Edited wiki page through web user interface.
    Revision r37 Edited wiki page through web user interface.
  • Aug 10, 2009
    SubversionLogToAtom (Convert output from svn log -v --xml to Atom) Wiki page added by mattimustang   -   Revision r36 Created wiki page through web user interface.
    Revision r36 Created wiki page through web user interface.
  • Aug 10, 2009
    IPAddressSummarization (Documentation and examples for the Wad of Stuff IP Summariza...) Wiki page added by mattimustang   -   Revision r35 Created wiki page through web user interface.
    Revision r35 Created wiki page through web user interface.
  • Aug 03, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by mattimustang   -   Hi, Sorry I haven't tried it with GAE. If you can get it working let me know and pass along any patches.
    Hi, Sorry I haven't tried it with GAE. If you can get it working let me know and pass along any patches.
  • Aug 03, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by delwyn.d   -   Brilliant serializer, using it in a few django apps. What is the best way to use it with the google app engine? Thanks in advance.
    Brilliant serializer, using it in a few django apps. What is the best way to use it with the google app engine? Thanks in advance.
  • Aug 01, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by mattimustang   -   You have to explicitly specify to depth you want to serialize to. e.g this will serial 3 relations deep. {{{ >>> print serializers.serialize('json', Group.objects.all(), indent=4, relations={ 'parent_item':{ 'relations':{ 'parent_item':{ 'relations':('parent_item',) } } } }) }}}
    You have to explicitly specify to depth you want to serialize to. e.g this will serial 3 relations deep. {{{ >>> print serializers.serialize('json', Group.objects.all(), indent=4, relations={ 'parent_item':{ 'relations':{ 'parent_item':{ 'relations':('parent_item',) } } } }) }}}
  • Jul 31, 2009
    r34 (Much improved version with: * command line arguments for s...) committed by mattimustang   -   Much improved version with: * command line arguments for svn log uri, title and Atom feed link. * better error handling. * SvnLogHandler no longer prints to stdout be stores everything in `content` property. * generate() function which can be imported by other python scripts.
    Much improved version with: * command line arguments for svn log uri, title and Atom feed link. * better error handling. * SvnLogHandler no longer prints to stdout be stores everything in `content` property. * generate() function which can be imported by other python scripts.
  • Jul 31, 2009
    DjangoFullSerializers (Documentation and examples for the Wad of Stuff Django Full ...) Wiki page commented on by sergio.berlotto   -   How to i serialize infinite model Tree, like this: class Item(models.Model): item_name: models.CharField(max_length=30) parent_item: models.ForeignKey(self) thank you
    How to i serialize infinite model Tree, like this: class Item(models.Model): item_name: models.CharField(max_length=30) parent_item: models.ForeignKey(self) thank you
  • Jul 24, 2009
    r33 (inlines support for generic views.) committed by mattimustang   -   inlines support for generic views.
    inlines support for generic views.
  • Jul 24, 2009
    r32 (fixed incorrect pypi name in INSTALL.) committed by mattimustang   -   fixed incorrect pypi name in INSTALL.
    fixed incorrect pypi name in INSTALL.
  • Jul 20, 2009
    r31 (svn log to atom script.) committed by mattimustang   -   svn log to atom script.
    svn log to atom script.
  • Jul 20, 2009
    wadofstuff-django-forms-1.0.0.tar.gz (Extended Dango forms) file uploaded by mattimustang   -  
    Labels: Featured Type-Source OpSys-All
    Labels: Featured Type-Source OpSys-All
  • Jul 20, 2009
    r30 (wadofstuff.django.forms) committed by mattimustang   -   wadofstuff.django.forms
    wadofstuff.django.forms
  • Jul 15, 2009
    issue 4 (Serialisation of reverse FK and M2M lookups) commented on by mark.ellul   -   Yes any chance of getting the patch into the svn trunk?
    Yes any chance of getting the patch into the svn trunk?
  • Jul 14, 2009
    issue 4 (Serialisation of reverse FK and M2M lookups) commented on by munhitsu   -   Any chance to get the patch into svn trunk?
    Any chance to get the patch into svn trunk?
  • May 23, 2009
    wadofstuff-django-serializers-1.0.0.tar.gz (Extended Serializers for Django) file uploaded by mattimustang   -  
    Labels: Featured Type-Source OpSys-All
    Labels: Featured Type-Source OpSys-All
  • May 23, 2009
    r28 (relocated serializers into own code tree so and add setup.py...) committed by mattimustang   -   relocated serializers into own code tree so and add setup.py LICENSE etc.
    relocated serializers into own code tree so and add setup.py LICENSE etc.
  • May 23, 2009
    r27 (fixed some formatting) committed by mattimustang   -   fixed some formatting
    fixed some formatting
  • May 23, 2009
    wadofstuff-ip-1.0.0.tar.gz (Python IP summarization module) file uploaded by mattimustang   -  
    Labels: Featured Type-Source OpSys-All
    Labels: Featured Type-Source OpSys-All
 
Hosted by Google Code