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
(function(window) { | |
window.env = window.env || {}; | |
// Environment variables | |
window["env"]["api"] = "${API_URL}"; | |
window["env"]["google_maps_api"] = "${GOOGLE_MAPS_API}"; | |
window["env"]["gtm"] = "${GTM}"; | |
})(this); |
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
(function(window) { | |
window["env"] = window["env"] || {}; | |
// Environment variables | |
window["env"]["api"] = "http://localhost:8000"; | |
window["env"]["google_maps_api"] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"; | |
window["env"]["gtm"] = "GTM-xxxxxxx"; | |
})(this); |
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
import json | |
from marshmallow import ValidationError | |
from nameko_sqlalchemy import DatabaseSession | |
from werkzeug import Response | |
from books.exceptions import HttpError, NotFound, BadRequest | |
from books.models import DeclarativeBase, Book, Author | |
from books.schemas import BookSchema, CreateBookSchema | |
from datetime import datetime, timezone |
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 marshmallow import Schema, fields | |
class AuthorSchema(Schema): | |
id = fields.Int(required=True) | |
name = fields.Str(required=True) | |
gender = fields.Str(required=True) | |
created_at = fields.Date() | |
updated_at = fields.Date() |
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
import datetime | |
import enum | |
from sqlalchemy import (Column, DateTime, ForeignKey, Integer, String, Enum) | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import relationship | |
class GenderEnum(enum.Enum): | |
Male = 'Male' |
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
[packages] | |
nameko = "==3.0.0-rc9" | |
nameko-sqlalchemy= "==1.5.0" | |
alembic = "==1.6.5" | |
marshmallow= "==2.19.2" | |
sqlalchemy= "==1.4.22" | |
psycopg2-binary= "==2.9.1" | |
[dev-packages] | |
pytest= "==4.5.0" |
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
// component.ts | |
myLatLng = { lat: 48.829677, lng: 2.239609 };// Map Options | |
mapOptions: google.maps.MapOptions = { | |
center: this.myLatLng, | |
zoom: 10, | |
}; | |
markerOptions: google.maps.MarkerOptions = { icon: 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi-dotless.png' }; |
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
<!-- component.html --> | |
<google-map [options]="mapOptions" width="100%"> | |
<map-marker | |
*ngFor="let spot of spots" | |
[position]="{ lat: spot.lat, lng: spot.lng }" | |
[options]="markerOptions" | |
[clickable]="true" | |
(mapClick)="selectMarker(spot)" | |
></map-marker> | |
</google-map> |
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
// component.ts | |
myLatLng = { lat: 48.829677, lng: 2.239609 }; // Map Options | |
mapOptions: google.maps.MapOptions = { | |
center: this.myLatLng, | |
zoom: 10, | |
}; | |
markerOptions: google.maps.MarkerOptions = {}; |
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
<!-- component.html --> | |
<google-map [options]="mapOptions" width="100%"> | |
<map-marker *ngFor="let spot of spots" | |
[position]="{ lat: spot.lat, lng: spot.lng }" | |
[options]="markerOptions"></map-marker> | |
</google-map> |