Posts

Showing posts from October, 2013

bootstrap form with single text input

http://stackoverflow.com/questions/15239236/bootstrap-modal-dialogs-with-a-single-text-input-field-always-dismiss-on-enter-k

Optimize saving FK and M2M relationships in django

See also http://stackoverflow.com/questions/2846029/django-set-foreign-key-using-integer     employee = Employee ( first_name = "Name" , last_name = "Name" )     employee . type_id = 4     employee . save (update_fields = ["type",]) ForeignKey and M2M fields store their value in an attribute with _id at the end, which you can access directly to avoid visiting the database.