简体   繁体   中英

does we use generic class view more often than function based view in django rest framework

As I am fan of function based view in django_rest because it lets you more control over the class based one. but we have seen most of the functionality of django_rest can be implemented with the generic class based views eg pagination, search, filter etc.

Could you please advice me should i use generic views more often if not then why I shouldn't?

Thanks in advance

No, use the provided base classes as much as possible to reuse their functionality. That's why it's there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM