Beispiel #1
0
def view_user_suggestions(request):
    check_is_admin(request.user)
    if request.method == "POST":
        post_values = request.POST

        name = post_values['name']
        address1 = post_values['address']
        address2 = post_values['address-line-2']
        city = post_values['city']
        state_code = post_values['state-code']
        zip_code = post_values['zip-code']
        latitude = post_values['latitude']
        longitude = post_values['longitude']
        phone = post_values['phone']
        website = post_values['website']
        facebook = post_values['facebook']
        email = post_values['email']

        if address2 is None:
            address2 = ''

        else:
            suggestion = UserStoreSuggestion.objects.get(id=post_values['id'])

            business = Business()
            business.name = name
            business.website = website
            business.facebook = facebook
            business.save()

            store = Store()
            store.user = suggestion.user
            store.business = business
            store.phone = phone
            store.address1 = address1
            store.address2 = address2
            store.city = city
            store.state_code = state_code
            store.zip_code = zip_code
            store.latitude = latitude
            store.longitude = longitude
            store.save()

            suggestion.is_verified = True
            suggestion.save()
    new_suggestions = UserStoreSuggestion.objects.filter(is_verified=False)
    return render(request, 'view_user_suggestions.html', locals())
Beispiel #2
0
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.location_heading = 'Abingdon Towne Centre'
store.address1 = '376 Towne Centre Drive'
store.latitude = 36.701102
store.longitude = -81.977939
store.phone = '276-676-4263'.replace('-', '')
store.save()

create_store_log_item(store, STORE_STATUS, '2019-05-21T12:00:00+00:00')
create_store_log_item(store, STORE_ADDRESS, '2019-05-21T12:00:00+00:00')
create_store_log_item(store, STORE_PHONE, '2019-05-21T12:00:00+00:00')

###############################################################################
# Business
###############################################################################
business = Business(name='Huzzah Hobbies')
business.website = 'huzzahhobbies.com'
business.facebook = 'www.facebook.com/huzzah.hobbies.7'
business.save()

store = Store(business=business,
              city='Ashburn',
              state_code='VA',
              zip_code='20147')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '44927 George Washington Blvd'
store.latitude = 39.058097
store.longitude = -77.445812
store.phone = '703-466-0460'.replace('-', '')
store.save()
Beispiel #3
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='Mind Sculpt Games')
business.website = 'www.mindsculptgames.com'
business.facebook = 'www.facebook.com/mindsculptgames'
business.email = '*****@*****.**'
business.save()

store = Store(business=business,
              city='Great Bend',
              state_code='KS',
              zip_code='67530')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '2521 10th St'
store.latitude = 38.361049
store.longitude = -98.772931
store.phone = '620-603-8462'.replace('-', '')
store.save()
Beispiel #4
0
create_business_log_item(business, BUSINESS_STATUS,
                         '2019-05-13T12:00:00+00:00')
create_business_log_item(business, BUSINESS_WEBSITE,
                         '2019-05-13T12:00:00+00:00')
create_business_log_item(business, BUSINESS_EMAIL, '2019-05-13T12:00:00+00:00')
create_business_log_item(business, BUSINESS_FACEBOOK,
                         '2019-05-13T12:00:00+00:00')
create_store_log_item(store, STORE_STATUS, '2019-05-13T12:00:00+00:00')
create_store_log_item(store, STORE_ADDRESS, '2019-05-13T12:00:00+00:00')
create_store_log_item(store, STORE_PHONE, '2019-05-13T12:00:00+00:00')

###############################################################################
# Business
###############################################################################
business = Business(name='Enchanted Realms Games and Gifts')
business.website = 'www.enchantedrealmsgames.com'
business.facebook = 'www.facebook.com/PetriesGames'
business.save()

store = Store(business=business,
              city='Colorado Springs',
              state_code='CO',
              zip_code='80910')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '1050 S Academy Blvd'
store.latitude = 38.817881
store.longitude = -104.758201
store.phone = '719-418-2187'.replace('-', '')
store.save()
Beispiel #5
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='Game Night Games')
business.website = 'www.gamenightgames.com'
business.email = '*****@*****.**'
business.facebook = 'https://www.facebook.com/gamenightgames'
business.save()

store = Store(business=business,
              city='Salt Lake City',
              state_code='UT',
              zip_code='84106')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '2148 South 900 East'
store.address2 = 'Suite 2'
store.latitude = 40.724268
store.longitude = -111.865636
store.phone = '801-467-2400'.replace('-', '')
        city = json_obj['location']['city']
        state_code = json_obj['location']['state']
        zip_code = json_obj['location']['zip_code']
        latitude = json_obj['coordinates']['latitude']
        longitude = json_obj['coordinates']['longitude']

        if address2 is None:
            address2 = ''

        if Store.objects.filter(business__name=name,
                                city=city,
                                state_code=state_code,
                                zip_code=zip_code).exists():
            print('Store already exists: ' + str(json_obj))
        else:
            business = Business()
            business.name = name
            business.save()

            store = Store()
            store.business = business
            store.phone = json_obj['phone']
            store.address1 = address1
            store.address2 = address2
            store.city = city
            store.state_code = state_code
            store.zip_code = zip_code
            store.latitude = latitude
            store.longitude = longitude
            store.save()
Beispiel #7
0
create_business_log_item(business, BUSINESS_STATUS,
                         '2019-05-20T12:00:00+00:00')
create_business_log_item(business, BUSINESS_WEBSITE,
                         '2019-05-20T12:00:00+00:00')
create_business_log_item(business, BUSINESS_FACEBOOK,
                         '2019-05-20T12:00:00+00:00')
create_business_log_item(business, BUSINESS_EMAIL, '2019-05-20T12:00:00+00:00')
create_store_log_item(store, STORE_STATUS, '2019-05-20T12:00:00+00:00')
create_store_log_item(store, STORE_ADDRESS, '2019-05-20T12:00:00+00:00')
create_store_log_item(store, STORE_PHONE, '2019-05-20T12:00:00+00:00')

###############################################################################
# Business
###############################################################################
business = Business(name='G2K Games')
business.website = 'www.g2kgames.net'
business.facebook = 'https://www.facebook.com/G2KGAMES'
business.email = '*****@*****.**'
business.save()

store = Store(business=business,
              city='Morganton',
              state_code='NC',
              zip_code='28655')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.name = 'Morganton Heights Shopping Center'
store.address1 = 'E150 Morganton Heights Blvd'
store.latitude = 35.725135
store.longitude = -81.704035
store.phone = '828-438-1890'.replace('-', '')
Beispiel #8
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='First Turn Games')
business.website = 'www.firstturngames.com'
business.facebook = 'www.facebook.com/FirstTurnGames'
business.save()

store = Store(business=business,
              city='Cedar Rapids',
              state_code='IA',
              zip_code='52402')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '3645 1st Ave SE'
store.latitude = 42.015345
store.longitude = -91.633349
store.phone = '319-826-1289'.replace('-', '')
store.save()
Beispiel #9
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='Borderlands Comics and Games')
business.facebook = 'www.facebook.com/pages/Borderlands-Comics-and-Games/443080862461292'
business.save()

store = Store(business=business, city='Jacksonville', state_code='FL', zip_code='32225')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '10230 Atlantic Blvd'
store.address2 = '#11'
store.latitude = 30.322750
store.longitude = -81.534627
store.phone = '904-720-0774'.replace('-', '')
store.save()

create_business_log_item(business, BUSINESS_STATUS, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_WEBSITE, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_EMAIL, '2019-04-18T12:00:00+00:00')
Beispiel #10
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='Amazing Discoveries')
business.website = 'www.amazingmtg.com'
business.facebook = 'www.facebook.com/AmazingDiscoveriesCG'
business.save()

store = Store(business=business, city='Casa Grande', state_code='AZ', zip_code='85122')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '204 N Sacaton St'
store.latitude = 32.877465
store.longitude = -111.755649
store.phone = '520-274-9294'.replace('-', '')
store.save()

create_business_log_item(business, BUSINESS_STATUS, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_WEBSITE, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_FACEBOOK, '2019-04-18T12:00:00+00:00')
Beispiel #11
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='Your Hobby Place')
business.website = 'www.yourhobbyplace.com'
business.facebook = 'www.facebook.com/YourHobbyPlace'
business.email = '*****@*****.**'
business.save()

store = Store(business=business, city='Martinsburg', state_code='WV', zip_code='25404')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '77 Monroe St'
store.latitude = 39.482063
store.longitude = -77.950841
store.phone = '304-267-3110'.replace('-', '')
store.save()

create_business_log_item(business, BUSINESS_STATUS, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_WEBSITE, '2019-04-18T12:00:00+00:00')
Beispiel #12
0
from apps.finder.models import Store
from scripts.functions import create_business_log_item
from scripts.functions import create_store_log_item

BUSINESS_STATUS = settings.GLOBAL_CONSTANTS['BUSINESS_STATUS']
BUSINESS_WEBSITE = settings.GLOBAL_CONSTANTS['BUSINESS_WEBSITE']
BUSINESS_EMAIL = settings.GLOBAL_CONSTANTS['BUSINESS_EMAIL']
BUSINESS_FACEBOOK = settings.GLOBAL_CONSTANTS['BUSINESS_FACEBOOK']
STORE_STATUS = settings.GLOBAL_CONSTANTS['STORE_STATUS']
STORE_ADDRESS = settings.GLOBAL_CONSTANTS['STORE_ADDRESS']
STORE_PHONE = settings.GLOBAL_CONSTANTS['STORE_PHONE']

###############################################################################
# Business
###############################################################################
business = Business(name='Labyrinth Games & Puzzles')
business.website = 'labyrinthgameshop.com'
business.facebook = 'www.facebook.com/labyrinthgameshop'
business.save()

store = Store(business=business, city='Washington', state_code='DC', zip_code='20003')
store.status = settings.GLOBAL_CONSTANTS['STATUS_OPEN']
store.address1 = '645 Pennsylvania Ave SE'
store.latitude = 38.884565
store.longitude = -76.996953
store.phone = '202-544-1059'.replace('-', '')
store.save()

create_business_log_item(business, BUSINESS_STATUS, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_WEBSITE, '2019-04-18T12:00:00+00:00')
create_business_log_item(business, BUSINESS_EMAIL, '2019-04-18T12:00:00+00:00')