Add gather location

Brightcells 8 年之前
父節點
當前提交
90d377ee6e
共有 3 個文件被更改,包括 25 次插入0 次删除
  1. 19 0
      group/migrations/0030_groupinfo_gather_location.py
  2. 2 0
      group/models.py
  3. 4 0
      group/tourguidegroup_views.py

+ 19 - 0
group/migrations/0030_groupinfo_gather_location.py

@@ -0,0 +1,19 @@
1
+# -*- coding: utf-8 -*-
2
+from __future__ import unicode_literals
3
+
4
+from django.db import models, migrations
5
+
6
+
7
+class Migration(migrations.Migration):
8
+
9
+    dependencies = [
10
+        ('group', '0029_auto_20161224_1616'),
11
+    ]
12
+
13
+    operations = [
14
+        migrations.AddField(
15
+            model_name='groupinfo',
16
+            name='gather_location',
17
+            field=models.CharField(help_text='\u65c5\u6e38\u56e2\u96c6\u5408\u5730\u70b9', max_length=255, null=True, verbose_name='gather_location', blank=True),
18
+        ),
19
+    ]

+ 2 - 0
group/models.py

@@ -46,6 +46,7 @@ class GroupInfo(CreateUpdateMixin):
46 46
     gather_at = models.DateTimeField(_(u'gather_at'), blank=True, null=True, help_text=_(u'旅游团集合时间'))
47 47
     gather_lon = models.FloatField(_(u'gather_lon'), blank=True, null=True, help_text=_(u'旅游团集合经度'))
48 48
     gather_lat = models.FloatField(_(u'gather_lat'), blank=True, null=True, help_text=_(u'旅游团集合纬度'))
49
+    gather_location = models.CharField(_(u'gather_location'), max_length=255, blank=True, null=True, help_text=u'旅游团集合地点')
49 50
 
50 51
     attentions_path = models.CharField(_(u'attentions_path'), max_length=255, blank=True, null=True, help_text=u'注意事项照片存放路径')
51 52
     schedules_path = models.CharField(_(u'schedules_path'), max_length=255, blank=True, null=True, help_text=u'行程安排照片存放路径')
@@ -89,6 +90,7 @@ class GroupInfo(CreateUpdateMixin):
89 90
             'gather_at': tc.remove_microsecond(self.gather_at),
90 91
             'gather_lon': self.gather_lon,
91 92
             'gather_lat': self.gather_lat,
93
+            'gather_location': self.gather_location,
92 94
             'created_at': tc.remove_microsecond(self.created_at),
93 95
             'banners': {
94 96
                 'attentions': self.group_attentions_url,

+ 4 - 0
group/tourguidegroup_views.py

@@ -131,6 +131,7 @@ def pai2_tginfo_api(request):
131 131
         group_info['gather_at'] = ''
132 132
         group_info['gather_lon'] = ''
133 133
         group_info['gather_lat'] = ''
134
+        group_info['gather_location'] = ''
134 135
 
135 136
     return response(200, 'Get Tour Guide Group Detail Info Success', u'获取旅行团详情成功', {
136 137
         'group_id': group_id,
@@ -236,6 +237,7 @@ def tg_group_gather_start_api(request):
236 237
     gather_at = tc.utc_string_to_utc_datetime(request.POST.get('gather_at', ''), format='%Y-%m-%dT%H:%M:%SZ')  # UTC, %Y-%m-%dT%H:%M:%SZ
237 238
     gather_lon = request.POST.get('lon', '')  # 经度
238 239
     gather_lat = request.POST.get('lat', '')  # 纬度
240
+    gather_location = request.POST.get('gather_location', '')  # 地点
239 241
 
240 242
     # 群组校验
241 243
     try:
@@ -251,6 +253,7 @@ def tg_group_gather_start_api(request):
251 253
     group.gather_at = gather_at
252 254
     group.gather_lon = gather_lon
253 255
     group.gather_lat = gather_lat
256
+    group.gather_location = gather_location
254 257
     group.save()
255 258
 
256 259
     # Redis 群组数据缓存更新
@@ -261,6 +264,7 @@ def tg_group_gather_start_api(request):
261 264
         'gather_at': gather_at,
262 265
         'gather_lon': gather_lon,
263 266
         'gather_lat': gather_lat,
267
+        'gather_location': gather_location,
264 268
     }, cls=DjangoJSONEncoder)).execute()
265 269
 
266 270
     # TODO: Inital user's geo location when start new gather info