Skip to content

Instantly share code, notes, and snippets.

View magyarn's full-sized avatar

Nathan Haynes-Magyar magyarn

  • University of Michigan Office of Academic Innovation
  • Ann Arbor, MI
View GitHub Profile
class SoftDeletableqQuerySet(models.QuerySet):
 
    def deleted(self):
        return self.exclude(deleted_at__isnull=True)
 
    def available(self):
        return self.exclude(deleted_at__isnull=False)
 
 
class SoftDeletableManager(models.Manager):
<p>Hello World</p>
<template>
<div>
<section class="wrapper">
<h2>Featured Items</h2>
<ul class="featured-items">
<li v-for="product in products" :key="product.id" class="featured-items__item">
<img class="product-image" :src="imagePath(product)" alt="">
<p class="product-title">{{ product.name }}</p>
<p><em>${{ product.price }}</em></p>
</li>
<template>
<nav class="navbar">
<span class="logo">
<router-link class="logo__link" :to="{name: 'home'}">InstaFlickr</router-link>
</span>
<form class="searchbar">
<label>
<span class='screen-reader-only'>Search:</span>
<input
v-model="tag"
<script>
...
export default {
...
created() {
this.fetchData()
},
data() {
...
<template>
<div class="wrapper">
<img class="photo" :src="imageUrl" alt="">
<h1>{{ title }}</h1>
<p>By {{ ownerName }}</p>
<h2>Description</h2>
<p>{{ description }}</p>
<h2>
Tags
</h2>
<template>
...
</template>
<script>
import flickr from '../flickr.js'
export default {
name: 'imageDetail',
props: {
<template>
...
</template>
<script>
import flickr from '../flickr.js'
export default {
name: 'imageDetail',
props: {
<template>
<div class="wrapper">
<h1>{{ title }}</h1>
<p>By {{ ownerName }}</p>
<h2>Description</h2>
<p>{{ description }}</p>
<h2>
Tags
</h2>
<ul v-if="tags.length" class="photo-tag-list">
<script>
export default {
...
computed: {
title() {
if (this.imageInfo) {
return this.imageInfo.title._content || 'Untitled Image'
}
return ''
},