Skip to content

Propuesta inicial context processor#360

Merged
sdelquin merged 10 commits intomasterfrom
issue#359
Jun 22, 2021
Merged

Propuesta inicial context processor#360
sdelquin merged 10 commits intomasterfrom
issue#359

Conversation

@euribates
Copy link
Copy Markdown
Collaborator

Ver issue #359

@euribates euribates changed the title Propuesta inicial Propuesta inicial context processor Jun 22, 2021
@euribates euribates requested a review from sdelquin June 22, 2021 07:47
@euribates euribates self-assigned this Jun 22, 2021
@euribates euribates added the refactorización Esta es una tarea de refactorización. No incluye cambio funcional label Jun 22, 2021
Comment thread main/settings.py Outdated
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient"
},
"KEY_PREFIX": "web"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quizás "pycan-web" o algo más identificativo?

Comment thread apps/commons/context_processors.py Outdated


def main_organization_data(request):
key = "web.organization"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quizás "pycan-web" o algo más identificativo?

Comment thread apps/commons/context_processors.py Outdated
else:
print("Cache hit")
return {
'organization': org,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu te me adelantaste para usar 'organization' jaja 😉

Comment thread apps/organizations/models.py Outdated
Cada vez que se almacene informacion en la tabla de organizaciones,
se elmimina la cache.
"""
key = "web.organization"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quizás "pycan-web" o algo más identificativo?

cache.delete(key)


post_save.connect(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto me parece una genialidad

Comment thread main/settings.py
if DEBUG:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lo que aprendo yo contigo...

@sdelquin sdelquin merged commit bddd61f into master Jun 22, 2021
@sdelquin sdelquin deleted the issue#359 branch June 22, 2021 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactorización Esta es una tarea de refactorización. No incluye cambio funcional

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants