This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand, CommandError | |
from django.utils import timezone | |
from crunchy_waffles_app.models import * | |
from crunchy_waffles_ops.models import ManagementLog | |
from crunchy_waffles_ops.crunchy_classes_ops.management_log import Management | |
import time | |
class Command(BaseCommand): | |
title = "Process Emails" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Added img tag to view picture | |
<img src="{{object.image.url}}"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, unicode_literals | |
import os | |
from celery import Celery | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crunchy_waffles.settings') | |
app = Celery('crunchy_waffles') | |
app.config_from_object('django.conf:settings', namespace='CELERY') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, unicode_literals | |
from celery import shared_task | |
@shared_task | |
def add(x, y): | |
return x + y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, unicode_literals | |
from celery import shared_task | |
from django.utils import timezone | |
from .models import * | |
@shared_task | |
def add(x, y): | |
return x + y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ObjectOwnerMixin: | |
def get_queryset(self): | |
return self.model.objects.filter(author=self.request.user) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from crunchy_waffles_app.errors import * | |
import requests | |
class EmailService: | |
subject = None | |
body = None | |
to = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NetworkMangaer { | |
static let shared = NetworkManager() | |
func sendEmail() { | |
// send email function | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from .models import * | |
admin.site.register(Sales) | |
admin.site.register(Products) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .models import * | |
from random import * | |
from decimal import Decimal | |
class Seeder: | |
def __init__(self): | |
self.products = ["Orange Ball", "Chew Toy 1", "Cat Bowl", "Dog Bed", "Cat Food", "Dog Food"] |