import mlab from models.river import River mlab7.connect() #Ex8 river_in_Africa = River.objects(continent="Africa") print(river_in_Africa) #Ex9 river_less_than_1000 = River.objects(continent="S. America", length__lt=1000) print(river_less_than_1000)
from ex1 import mlab_connect from models.river import River mlab_connect() rivers = River.objects(continent = 'Africa') if len(rivers) == 0: print("Not found") else: for river in rivers: print(river)
from models.river import River import mlab7 mlab7.connect() SA_river = River.objects(continent = "S. America") for river in SA_river: if river["length"] <= 1000: print(river["name"]) print("- "*10)
def river_america(): name_list = River.objects(continent="S. America", length__lt=1000) return render_template("ex23.html", name_list=name_list)
from pymongo import * import mlab from models.river import River mlab.connect() all_rivers_in_africa = River.objects() for river in all_rivers_in_africa: if river['continent'] == 'S. America' and river['length'] < 1000: print(river['name'])
def rivers1(): africa_river_list = River.objects(continent__icontains="S. America", length__lt=1000) return render_template("rivers1.html", africa_river_list=africa_river_list)
def river_africa(): river_list = River.objects(continent='Africa') return render_template("river.html",river_list=river_list)
from models.river import River import mlab7 mlab7.connect() all_river_s = River.objects(continent="S. America", length=1000) for river2 in all_river_s: print(river2.name) print()
from models.river import River import mlab1 mlab1.connect() rivers = River.objects(continent = "Africa") print ("All river in Africa") for item in rivers: print(item.name) print("-" * 20) print ("All river in S.America with length less than 1000km") short_river = River.objects(continent ="S. America",length__lt = 1000) for item in short_river: print(item.name,':',item.length)
from models.river import River import mlab7 mlab7.connect() river_in_SAmerica_lt1000km = River.objects(continent="S. America", length__lt=1000) for river in river_in_SAmerica_lt1000km: print(river.name) print(river.length) print("* " * 20)
from models.river import River import river.mlab river.mlab.connect() river_SA_1000 = River.objects(continent = "S. America", length__lt=1000) for river in river_SA_1000: print(river.name) print(river.length) print("*" * 10)
from mlab import mlab_connect from models.river import River mlab_connect() african_rivers = River.objects(continent="Africa") for river in african_rivers: print(river) samerican_rivers_1000 = River.objects(continent='S. America', length__lt=1000) for river in samerican_rivers_1000: print(river)
import mlab from models.river import River mlab.connect() print("ex2") river_list = River.objects(continent__iexact="Africa") for river in river_list: print(river.name) print("ex3") river_list = River.objects(continent__iexact="S. America", length__lt=1000) for river in river_list: print(river.name, river.length)
import mlab from models.river import River mlab.connect() Africa_river_list = River.objects(continent__icontains="Africa") print("all river in Africa: ", end="") for river in Africa_river_list: print(river.name, end=", ") print() print() S_America_river_list = River.objects(continent__icontains="S. America", length__lt=1000) print("all river in S.America with length less than 1000km: ", end="") for river in S_America_river_list: print(river.name, end=", ")
from models.river import River import mlab7 mlab7.connect() Africa_river = River.objects(continent="Africa") for river in Africa_river: print(river["name"]) print(river["length"]) print("- " * 10)
from ex1 import mlab_connect from models.river import River mlab_connect() rivers = River.objects(continent='S. America', length__lt=1000) if len(rivers) == 0: print("Not found") else: for river in rivers: print(river, river.length)
def rivers(): africa_river_list = River.objects(continent__icontains="Africa") return render_template("rivers.html", africa_river_list=africa_river_list)
def africa(): all_rivers = River.objects(continent="Africa") return render_template('rivers.html', all_rivers=all_rivers)
def river_samerica(): river_list = River.objects(continent='S.America',length__lt=100) return render_template('river.html',river_list=river_list)
def s_america(): all_rivers = River.objects(continent="S. America", lenght__lt=1000) return render_template('rivers.html', all_rivers=all_rivers)
from models.river import River import mlab7 mlab7.connect() river_in_Africa = River.objects(continent="Africa") for river in river_in_Africa: print(river.name) print(river.length) print("* " * 20)
def river(): name_list = River.objects(continent="Africa") return render_template("ex23.html", name_list=name_list)