Skip to content

Instantly share code, notes, and snippets.

version: '3'
services:
postgres:
environment:
POSTGRES_USER: ${POSTGRES_DB_USER}
POSTGRES_PASSWORD: ${POSTGRES_DB_PW}
POSTGRES_DB: ${POSTGRES_DB_NAME}
restart: always
image: postgres
[Vue warn]: Property or method "product" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
found in
---> <Product>
<Root>
[Vue warn]: Error in render function: "TypeError: Cannot read property 'name' of undefined"
found in
from django.contrib import admin
from django import forms
from .models import Vendor, Vendor_Feature
#uploading an image form, o clue if this area is right
#-----
class UploadImageForm(forms.UploadImage):
logo_form = forms.ImageField()
{% for vendor in vendor_list %}
<div class="col-lg-3 col-sm-4 col-xs-6">
{% if vendor.logo %}
test
<img class=".img-fluid" src="data:image/png;base64,{{ vendor.logo }}">
{% else %}
<img src="https://placeholdit.imgix.net/~text?txtsize=20&txt=THMBN&w=120&h=120"></img>
{% endif %}
<h3><a href="{% url 'catalog:detail' vendor.id %}">{{ vendor.name }}</a></h3>
<h5>{{ vendor.brief }}</h5>
def parse_detail(self, response):
#parsing agent for the actual home detail we are interested in
addr_bbs = response.xpath('//h3/span[@class="addr_bbs"]/text()').extract()
addr1 = response.xpath('//h1[@class="notranslate"]/text()').extract()
addr2 = response.xpath('//h1[@class="notranslate"]/span/text()').extract()
item = PropertyItem()
item['address1'] = ''.join(addr1)
item['address2'] = ''.join(addr2)
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 152,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "skip"
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [],
{
"cells": [
{
"cell_type": "code",
"execution_count": 455,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "skip"
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 90,
"metadata": {
"collapsed": false
},
"outputs": [
{