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 - Where to place the call to a external API that has a dependency on a Model? -


suppose have django app named "blog".

there's model called post , have external api call returns list of popular posts in given time, e.g., google analytics api.

my question is: expected place should place code makes call external api, parses id each post, query database , sort list of models accordingly?

i don't think should live in manager or in templatetag. tips or suggestions?

thanks in advance!

edit: desired result might need in several places across project, if place code in view, i'll have duplication.

it should done in view, or better, if view code getting cluttered, put in helper module.

import util def view(request):     util.process_post_rankings(request.user.id)     # ... write additional logic , render template 

however, cautious relying on external apis render page user. things might go wrong, take awful lot of time, api might not respond etc... better asynchronously javascript, , update page when data ready.


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 -