This file contains 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
{ | |
/* | |
// Place your snippets for Vue-html here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ |
This file contains 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
{ | |
"Complete v-flex": { "prefix": "flex", "body": ["<v-flex>$0</v-flex>"], "description": "complete <v-flex>" }, | |
"Complete v-avatar": { "prefix": "avatar", "body": ["<v-avatar>$0</v-avatar>"], "description": "complete <v-avatar>" }, | |
"Complete v-badge": { "prefix": "badge", "body": ["<v-badge>$0</v-badge>"], "description": "complete <v-badge>" }, | |
"Complete v-breadcrumbs": { "prefix": "breadcrumbs", "body": ["<v-breadcrumbs>$0</v-breadcrumbs>"], "description": "complete <v-breadcrumbs>" }, | |
"Complete v-breadcrumbs-item": { "prefix": "breadcrumbs-item", "body": ["<v-breadcrumbs-item>$0</v-breadcrumbs-item>"], "description": "complete <v-breadcrumbs-item>" }, |
This file contains 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
proxyTable: { | |
'/api': { | |
target: 'http://127.0.0.1:8000', | |
changeOrigin: true | |
}, | |
'/haldus': { | |
target: 'http://127.0.0.1:8000', | |
changeOrigin: true | |
}, | |
'/static': { |
This file contains 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
proxyTable: { | |
'/api': { | |
target: 'http://127.0.0.1:8000', | |
changeOrigin: true | |
}, | |
'/haldus': { | |
target: 'http://127.0.0.1:8000', | |
changeOrigin: true | |
}, | |
'/static': { |
This file contains 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
import re | |
from django.test import TestCase, Client | |
from django.contrib.auth.models import User | |
LINK_PATTERN = re.compile(r'<a href="(/admin/[^ ]+)"') | |
class TestDjangoAdmin(TestCase): |
This file contains 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 Charity(models.Model): | |
name = models.CharField(max_length=50, unique=True) | |
webpage = models.URLField(unique=True) | |
def __str__(self): | |
return self.name | |
class Volunteer(models.Model): | |
charity = models.ForeignKey(Charity, on_delete=models.PROTECT) |
This file contains 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
def project_factory(director, name='Project__name', deadline=datetime.date.today()): | |
return Project.objects.create( | |
director=director, | |
name=name, | |
deadline=deadline | |
) |
This file contains 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 factory.django import DjangoModelFactory as ModelFactory | |
class ProjectFactory(ModelFactory): | |
class Meta: | |
model = Project | |
director = factory.SubFactory(VolunteerFactory) # Creates dependency | |
warehouse = factory.Sequence(lambda n: f'Project__name-{n}') # Guarantees uniqueness | |
deadline = factory.LazyFunction(datetime.date.today) |
This file contains 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 factoryman import create_populated_modelfactory | |
ProjectFactory = create_populated_modelfactory(Project) | |
ExpiredProjectFactory = create_populated_modelfactory(Project, deadline='1999-04-04') |
This file contains 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
# TÖÖJAAM | |
# See eelsätetefail on loodud toetudes dokumentatsioonile: | |
# https://help.ubuntu.com/lts/installation-guide/amd64/apbs04.html | |
# Kuna tegemist on “Töölaua” versiooniga, siis kasutan debian-installer käske ubiquity formaadis. Ubiquity on live-paigaldus keskkond. | |
# Kettajagude loomine | |
# Esimese SCSI/SATA ketta kasutamise valimine | |
ubiquity partman-auto/disk string /dev/sda | |
# Kettajagude loomise meetodi valimine. Variandid kas “regular” , “lvm” või “crypto”. Viimasel kahel juhul kasutatakse LVM kettajagude süsteemi. Viimasel juhul kasutatakse ka krüpteeringut. | |
ubiquity partman-auto/method string regular |