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
furniture/__init__.py | |
import os | |
# Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. | |
VERSION = (1, 6, 0, 'dev') | |
def get_short_version(): | |
return '%s.%s' % (VERSION[0], VERSION[1]) |
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 gql from 'graphql-tag'; | |
import { commonResponse } from 'app/gql/fragments'; | |
export default gql` | |
mutation AddCommentMutation($commentData: AddCommentInput!){ | |
addComment(addCommentData: $commentData){ | |
...ResponseFrag | |
} | |
} | |
${commonResponse} |
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
//reducer for adding and updating menu. Adding is working fine but editing is not working as in editing, the user can switch | |
// from one menu to another | |
const restaurantsMenu = { | |
food_beverages: { | |
restaurant: { | |
food_menu: [], | |
beverages_menu: [] | |
}, | |
coffee_shop: { |
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
# credit - zsoobhan from SO (https://stackoverflow.com/questions/46731426/show-distance-in-km-or-m-of-each-restaurant/46732398#46732398) | |
def calculate_distance(restaurant, current_lat, current_long): | |
from django.contrib.gis.geos import GEOSGeometry | |
pnt = GEOSGeometry(restaurant.location) | |
pnt2 = GEOSGeometry('SRID=4326;POINT({0} {1})'.format( | |
current_long, current_lat)) | |
print(pnt.distance(pnt2) * 100) | |
return round(pnt.distance(pnt2) * 100, 2) |
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 React from 'react'; | |
import Link from 'react-router-dom/Link'; | |
import { Label, Menu, Table } from 'semantic-ui-react'; | |
import { capitalize } from 'utils/helper'; | |
import { isEmpty } from 'utils/helper'; | |
const perPageToShow = 10; | |
const style = { | |
paginationBtn: { |
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 React from 'react'; | |
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; | |
const transitionOptions = { | |
transitionName: 'notification-fade', | |
transitionEnterTimeout: 400, | |
transitionLeaveTimeout: 400 | |
}; | |
const LogList = ({ logs, ...props }) => { |
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
export const logRequest = action(LOGS_FETCH_REQUEST); | |
export const logFetched = action(LOGS_FETCH_SUCCESS, "logs"); | |
export const logFetchingError = action(LOGS_FETCH_FAILURE, "error"); | |
where action is a generic function | |
export default function action(TYPE, ...keys) { | |
return (...values) => { | |
const axn = { type: TYPE }; |
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 django.db import models | |
from django.conf import settings | |
from django.core.urlresolvers import reverse | |
from django.utils.translation import ugettext_lazy as _ | |
from smart_selects.db_fields import ChainedForeignKey | |
class PropertyType(models.Model): | |
"""Class that implements properties types, as House or Apartment.""" |
NewerOlder