mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-20 23:20:57 +00:00
1 line
3.0 KiB
JSON
1 line
3.0 KiB
JSON
[{"user_id": 7, "stars": [], "topic_id": 8179, "date_created": 1298415732.275275, "message": "I don't understand.", "group_id": 81, "id": 184867}, {"user_id": 8384, "stars": [], "topic_id": 8179, "date_created": 1298415638.2736571, "message": "I would like to create a custom model field that does not require a db column. Weird I know, but it's true. I've searched the docs and have only found how to avoid the initial sql that builds the column. http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#django.db.models.Field.db_type", "group_id": 81, "id": 184843}, {"user_id": 7, "stars": [], "topic_id": 8179, "date_created": 1298415748.662112, "message": "How would the object know what file it has if you don't store it?", "group_id": 81, "id": 184870}, {"user_id": 14831, "stars": [], "topic_id": 8179, "date_created": 1298416089.659941, "message": "you can add an extra field in your ModelForm without affecting your db", "group_id": 81, "id": 184917}, {"user_id": 592, "stars": [], "topic_id": 8179, "date_created": 1298416680.8553431, "message": "Since you don't store it, its not really a \"model field\" in terms on Django - doesn't that just make it a class property?", "group_id": 81, "id": 184981}, {"user_id": 8384, "stars": [], "topic_id": 8179, "date_created": 1298418603.1251121, "message": "I have a Files model that stores content_type and object_id. I'm using this Files model to hold all file objects. Now I want to associate files to a random model. Let's say a person object. So within the Person model I would really like to have have a CustomField() that updates the Files model DB and not it's own Person model DB.", "group_id": 81, "id": 185135}, {"user_id": 1736, "stars": [], "topic_id": 8179, "date_created": 1298419781.932524, "message": "Sounds like a job for a very very custom field class that emulated both a foreignkey and a file field.", "group_id": 81, "id": 185200}, {"user_id": 719, "stars": [], "topic_id": 8179, "date_created": 1298420595.787801, "message": "GenericForeignKey?", "group_id": 81, "id": 185232}, {"user_id": 1736, "stars": [], "topic_id": 8179, "date_created": 1298421928.3340161, "message": "Alternatively add a FileField to the form yourself and then handle putting it in the correct model in your code", "group_id": 81, "id": 185307}, {"user_id": 8384, "stars": [], "topic_id": 8179, "date_created": 1298485900.4460039, "message": "Thank you everyone. I really appreciate the help! It's comforting to know that this is not an ideal request. I was worried I was racking my brain for no reason.", "group_id": 81, "id": 189597}, {"user_id": 2588, "stars": [], "topic_id": 8179, "date_created": 1298492119.585058, "message": "@eloy what is the advantage of this \"CustomField\" over using a GenericForeignKey?", "group_id": 81, "id": 190599}, {"user_id": 8384, "stars": [], "topic_id": 8179, "date_created": 1298513785.160907, "message": "The advantage of the CustomField is that it's Many-to-One when I use the custom field on the Model as opposed to One-to-Many. Only difference, I think.", "group_id": 81, "id": 194872}] |