Model recommendations - Deepstash
Metaverse

Learn more about computerscience with this collection

Find out the challenges it poses

Learn about the potential impact on society

Understanding the concept of Metaverse

Metaverse

Discover 76 similar ideas in

It takes just

11 mins to read

Model recommendations

Model recommendations

  • Alternate/complex constructors for model instances should be implemented as manager methods. (e.g. User.objects.create_user)
  • Custom, complex or often-used queries on the entire table should be implemented as QuerySet or manager methods.
  • Table-level queries should be implemented as a QuerySet method when they need to be chained, and as a manager method otherwise.
  • Complex fetching of related objects from a model instance should be implemented as a model method.

3

14 reads

MORE IDEAS ON THIS

Business logic

Business logic

  • Business logic refers to common queries and operations that are performed repeatedly on models.
  • Views should contain little business logic and rely on models for that.
  • Logic that involves one model instance should go on the model class; logic...

4

34 reads

Limit model access

Limit model access

For code outside of the model class:

  • Access to model fields for reading should be discouraged --> Instead define model methods that implement the logic you need
  • Access to model fields for writing should be forbidden --> Instead define mod...

3

15 reads

CURATED FROM

CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates