init
This commit is contained in:
parent
55c7b6e5a5
commit
e162753517
|
@ -15,8 +15,9 @@ class Category(models.Model):
|
|||
(u'基础地理数据', u'基础地理数据'),
|
||||
(u'遥感数据', u'遥感数据'),
|
||||
(u'G214国道', u'G214国道'),
|
||||
(u'花石峡冻土观测站', u'花石峡冻土观测站'),
|
||||
(u'青海冻土观测基地', u'青海冻土观测基地'),
|
||||
(u'冻土观测基地(旧)', u'冻土观测基地(旧)'),
|
||||
(u'冻土观测基地(新)', u'冻土观测基地(新)'),
|
||||
(u'施工设计资料', u'施工设计资料'),
|
||||
)
|
||||
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<a href="{% url 'metadata_index' %}?category=2">遥感影像</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'sources' %}">施工设计资料</a>
|
||||
<a href="{% url 'metadata_index' %}%category=6">施工设计资料</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'metadata_index' %}?category=3">G214国道</a>
|
||||
|
|
|
@ -20,24 +20,19 @@ def index(request):
|
|||
category = request.GET.get('category', 1)
|
||||
|
||||
if category == '1':
|
||||
|
||||
metadatas = Metadata.objects.filter(category__name=u'基础地理数据').all()
|
||||
|
||||
elif category == '2':
|
||||
|
||||
metadatas = Metadata.objects.filter(category__name=u'遥感数据').all()
|
||||
|
||||
elif category == '3':
|
||||
|
||||
metadatas = Metadata.objects.filter(category__name=u'G214国道').all()
|
||||
|
||||
elif category == '4':
|
||||
|
||||
metadatas = Metadata.objects.filter(category__name=u'花石峡冻土观测站').all()
|
||||
metadatas = Metadata.objects.filter(category__name=u'冻土观测基地(旧)').all()
|
||||
|
||||
elif category == '5':
|
||||
|
||||
metadatas = Metadata.objects.filter(category__name=u'青海冻土观测基地').all()
|
||||
metadatas = Metadata.objects.filter(category__name=u'冻土观测基地(新)').all()
|
||||
else:
|
||||
metadatas = Metadata.objects.all()
|
||||
|
||||
|
|
Loading…
Reference in New Issue