News for hackers. Stuff that matters.
Re:Show HN: Django Model Parsing with Python's AST module by natrius on Saturday October 13, 2012 @02:37PM (#4649272)
Parsing the text of models isn't the best way to get information about them. The _meta attribute of a model provides tons of information about a model, its fields, and how to deal with its database representation.

Parsers are neat in general, so if you had fun with it, more power to you.

Re:Show HN: Django Model Parsing with Python's AST module by fatiherikli on Saturday October 13, 2012 @02:44PM (#4649295)
It's true, but the _meta way is not convenient for my use case. I am parsing uploaded python script (django model).
Re:Show HN: Django Model Parsing with Python's AST module by natrius on Saturday October 13, 2012 @02:53PM (#4649326)
I don't understand how you can run your parser if you can't run arbitrary Python code.
Re:Show HN: Django Model Parsing with Python's AST module by mcantelon on Saturday October 13, 2012 @02:59PM (#4649350)
Running untrusted code someone has uploaded is risky.
Re:Show HN: Django Model Parsing with Python's AST module by natrius on Saturday October 13, 2012 @03:11PM (#4649386)
Oh, I get it. User-uploaded Django models. Makes sense.