Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

python - Read-only Django object manager? -


i doing agressive caching , i'd make sure nobody accidentally writes code updates database directly. imagine way solve rename normal object manager .rw_objects caches use, , replace .objects manager logs warning on non-updating access , throws exception if tries update it.

i've written object manager , query set i'm not sure how go checking whether query updating database.

any suggestions?

i'm thinking 2 approaches here.

  1. create custom manager, override _insert(), _update() raise exception / log query, , get_query_set() return custom queryset overrides create(), get_or_create(), , update().

  2. if you're using django 1.2, create database connection in settings.py call "read_only", , create custom manager returns querset using connection (like def get_query_set() return super(readonlymanager, self).get_query_set().using("read_only"), , mark connection read-only. (one way create read-only user database connection "read_only".... if you're using postgres, can stuff how create read-only user in postgresql?)


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -