On Tue, May 20, 2008 at 10:32 AM, oliver <[EMAIL PROTECTED]> wrote:
> I take it doing via JSON you still need to convert the Boolean fields?
>
> would you know of any kind of scrip that would do it? as my editor
> doenst cope to well with 7mb of xml files :(.
> I guess its not to hard to write if needed.

If you're on linux, there's sed and awk, or you could go ridiculously
old school and build something out of cut, paste, tr, grep, sort, uniq
etc., or you could write a little python filter to do it all for you:

import sys

for line in sys.stdin:
    # change the line somehow
    print line

or you could write something in perl, or you could...

I have a filter that makes django's json-dumps more human-readable, by
adding a newline after every occurence of "}},". Running such a filter
first would make for short and snappy lines for the rewriting filter:

python manage.py dumpdata | prettifyjson | fixbooleans > postgres_safe.json


HM

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to