Best Python code snippet using selene_python
bulk_uploader.py
Source:bulk_uploader.py
...58 """59 Wrapper method to save icons in a local directory to the database and media store.60 """61 # I62 nouns = Category.objects.get_or_create(name=_('Nouns'))[0]63 # I.A64 culture = Category.objects.get_or_create(65 name=_('Culture'), parent=nouns)[0]66 # I.A.167 creating = Category.objects.get_or_create(68 name=_('Creating'), parent=culture)[0]69 craft = Category.objects.get_or_create(70 name=_('Craft'), parent=creating)[0]71 cls.__upload(72 os.path.join(directory, 'Nouns/βCulture/βCreating/βCraft'), craft)73 performance = Category.objects.get_or_create(74 name=_('Performance'), parent=creating)[0]75 cls.__upload(76 os.path.join(directory, 'Nouns/βCulture/βCreating/βPerformance'),77 performance)78 visual_art = Category.objects.get_or_create(79 name=_('Visual Art'), parent=creating)[0]80 cls.__upload(81 os.path.join(directory, 'Nouns/βCulture/βCreating/βVisual Art'),82 visual_art)83 negatives = Category.objects.get_or_create(84 name=_('Negatives'), parent=creating)[0]85 cls.__upload(86 os.path.join(directory, 'Nouns/βCulture/βCreating/βNegatives'),87 negatives)88 # I.A.289 eating_drinking = Category.objects.get_or_create(90 name=_('Eating & Drinking'), parent=culture)[0]91 cook = Category.objects.get_or_create(92 name=_('Cook'), parent=eating_drinking)[0]93 cls.__upload(94 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βCook'),95 cook)96 dairy = Category.objects.get_or_create(97 name=_('Dairy'), parent=eating_drinking)[0]98 cls.__upload(99 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βDairy'),100 dairy)101 drinks = Category.objects.get_or_create(102 name=_('Drinks'), parent=eating_drinking)[0]103 cls.__upload(104 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βDrinks'),105 drinks)106 fruit = Category.objects.get_or_create(107 name=_('Fruit'), parent=eating_drinking)[0]108 cls.__upload(109 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βFruit'),110 fruit)111 grains = Category.objects.get_or_create(112 name=_('Grains'), parent=eating_drinking)[0]113 cls.__upload(114 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βGrains'),115 grains)116 groceries = Category.objects.get_or_create(117 name=_('Groceries'), parent=eating_drinking)[0]118 cls.__upload(119 os.path.join(120 directory, 'Nouns/βCulture/βEating & Drinking/βGroceries'),121 groceries)122 meals = Category.objects.get_or_create(123 name=_('Meals'), parent=eating_drinking)[0]124 cls.__upload(125 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βMeals'),126 meals)127 meat_and_fish = Category.objects.get_or_create(128 name=_('Meat, Animals & Fish'), parent=eating_drinking)[0]129 cls.__upload(130 os.path.join(131 directory, 'Nouns/βCulture/βEating & Drinking/βMeat & Fish'),132 meat_and_fish)133 sweets = Category.objects.get_or_create(134 name=_('Sweets'), parent=eating_drinking)[0]135 cls.__upload(136 os.path.join(directory, 'Nouns/βCulture/βEating & Drinking/βSweets'),137 sweets)138 vegetables = Category.objects.get_or_create(139 name=_('Vegetables'), parent=eating_drinking)[0]140 cls.__upload(141 os.path.join(142 directory, 'Nouns/βCulture/βEating & Drinking/βVegetables'),143 vegetables)144 negatives = Category.objects.get_or_create(145 name=_('Negatives'), parent=eating_drinking)[0]146 cls.__upload(147 os.path.join(148 directory, 'Nouns/βCulture/βEating & Drinking/βNegatives'),149 negatives)150 # I.A.3151 feeling = Category.objects.get_or_create(152 name=_('Feeling'), parent=culture)[0]153 # I.A.3.a154 gestures = Category.objects.get_or_create(155 name=_('Gestures'), parent=feeling)[0]156 generic = Category.objects.get_or_create(157 name=_('Generic'), parent=feeling)[0]158 cls.__upload(159 os.path.join(directory, 'Nouns/βCulture/βFeeling/βGestures/βGeneric'),160 generic)161 negatives = Category.objects.get_or_create(162 name=_('Negatives'), parent=feeling)[0]163 cls.__upload(164 os.path.join(directory, 'Nouns/βCulture/βFeeling/βGestures/βNegatives'),165 negatives)166 # I.A.3.b167 hearts = Category.objects.get_or_create(168 name=_('Hearts'), parent=feeling)[0]169 generic = Category.objects.get_or_create(170 name=_('Generic'), parent=feeling)[0]171 cls.__upload(172 os.path.join(directory, 'Nouns/βCulture/βFeeling/βHearts/βGeneric'),173 generic)174 negatives = Category.objects.get_or_create(175 name=_('Negatives'), parent=feeling)[0]176 cls.__upload(177 os.path.join(directory, 'Nouns/βCulture/βFeeling/βHearts/βNegatives'),178 negatives)179 # I.A.3.a180 faces = Category.objects.get_or_create(181 name=_('Faces'), parent=feeling)[0]182 eyes = Category.objects.get_or_create(name=_('Eyes'), parent=faces)[0]183 cls.__upload(184 os.path.join(directory, 'Nouns/βCulture/βFeeling/βFaces/βEyes'), eyes)185 masks = Category.objects.get_or_create(name=_('Masks'), parent=faces)[0]186 cls.__upload(187 os.path.join(directory, 'Nouns/βCulture/βFeeling/βFaces/βMasks'), masks)188 mouths = Category.objects.get_or_create(189 name=_('Mouths'), parent=faces)[0]190 cls.__upload(191 os.path.join(directory, 'Nouns/βCulture/βFeeling/βFaces/βMouths'),192 mouths)193 # I.A.4194 governing = Category.objects.get_or_create(195 name=_('Governing'), parent=culture)[0]196 law = Category.objects.get_or_create(name=_('Law'), parent=governing)[0]197 cls.__upload(198 os.path.join(directory, 'Nouns/βCulture/βGoverning/βLaw'), law)199 politics = Category.objects.get_or_create(200 name=_('Politics'), parent=governing)[0]201 cls.__upload(202 os.path.join(directory, 'Nouns/βCulture/βGoverning/βPolitics'),203 politics)204 negatives = Category.objects.get_or_create(205 name=_('Negatives'), parent=governing)[0]206 cls.__upload(207 os.path.join(directory, 'Nouns/βCulture/βGoverning/βNegatives'),208 negatives)209 # I.A.5210 healing = Category.objects.get_or_create(211 name=_('Healing'), parent=culture)[0]212 health = Category.objects.get_or_create(213 name=_('Health'), parent=healing)[0]214 cls.__upload(215 os.path.join(directory, 'Nouns/βCulture/βHealing/βHealth'), health)216 negatives = Category.objects.get_or_create(217 name=_('Negatives'), parent=healing)[0]218 cls.__upload(219 os.path.join(directory, 'Nouns/βCulture/βHealing/βNegatives'),220 negatives)221 # I.A.5.a222 body = Category.objects.get_or_create(name=_('Body'), parent=healing)[0]223 generic = Category.objects.get_or_create(224 name=_('Generic'), parent=body)[0]225 cls.__upload(226 os.path.join(directory, 'Nouns/βCulture/βHealing/βBody/βGeneric'),227 generic)228 death = Category.objects.get_or_create(name=_('Death'), parent=body)[0]229 cls.__upload(230 os.path.join(directory, 'Nouns/βCulture/βHealing/βBody/βDeath'), death)231 fitness = Category.objects.get_or_create(232 name=_('Fitness'), parent=body)[0]233 cls.__upload(234 os.path.join(directory, 'Nouns/βCulture/βHealing/βBody/βFitness'),235 fitness)236 pain = Category.objects.get_or_create(name=_('Pain'), parent=body)[0]237 cls.__upload(238 os.path.join(directory, 'Nouns/βCulture/βHealing/βBody/βPain'), pain)239 pregnancy = Category.objects.get_or_create(240 name=_('Pregnancy'), parent=body)[0]241 cls.__upload(242 os.path.join(directory, 'Nouns/βCulture/βHealing/βBody/βPregnancy'),243 pregnancy)244 senses = Category.objects.get_or_create(245 name=_('Senses'), parent=body)[0]246 cls.__upload(247 os.path.join(directory, 'Nouns/βCulture/βHealing/βBody/βSenses'),248 senses)249 # I.A.6250 housing = Category.objects.get_or_create(251 name=_('Housing'), parent=culture)[0]252 infrastructure = Category.objects.get_or_create(253 name=_('Infrastructure'), parent=housing)[0]254 cls.__upload(255 os.path.join(directory, 'Nouns/βCulture/βHousing/βInfrastructure'),256 infrastructure)257 interior = Category.objects.get_or_create(258 name=_('Interior'), parent=housing)[0]259 cls.__upload(260 os.path.join(directory, 'Nouns/βCulture/βHousing/βInterior'), interior)261 landscape = Category.objects.get_or_create(262 name=_('Landscape'), parent=housing)[0]263 cls.__upload(264 os.path.join(directory, 'Nouns/βCulture/βHousing/βLandscape'),265 landscape)266 public_buildings = Category.objects.get_or_create(267 name=_('Public Buildings'), parent=housing)[0]268 cls.__upload(269 os.path.join(directory, 'Nouns/βCulture/βHousing/βPublic Buildings'),270 public_buildings)271 types = Category.objects.get_or_create(272 name=_('Types'), parent=housing)[0]273 cls.__upload(274 os.path.join(directory, 'Nouns/βCulture/βHousing/βTypes'), types)275 negatives = Category.objects.get_or_create(276 name=_('Negatives'), parent=housing)[0]277 cls.__upload(278 os.path.join(directory, 'Nouns/βCulture/βHousing/βNegatives'),279 negatives)280 # I.A.6.a281 rooms = Category.objects.get_or_create(282 name=_('Rooms'), parent=housing)[0]283 basement = Category.objects.get_or_create(284 name=_('Basement'), parent=rooms)[0]285 cls.__upload(286 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βBasement'),287 basement)288 bathroom = Category.objects.get_or_create(289 name=_('Bathroom'), parent=rooms)[0]290 cls.__upload(291 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βBathroom'),292 bathroom)293 bedroom = Category.objects.get_or_create(294 name=_('Bedroom'), parent=rooms)[0]295 cls.__upload(296 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βBedroom'),297 bedroom)298 dining = Category.objects.get_or_create(299 name=_('Dining Room'), parent=rooms)[0]300 cls.__upload(301 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βDining Room'),302 dining)303 kitchen = Category.objects.get_or_create(304 name=_('Kitchen'), parent=rooms)[0]305 cls.__upload(306 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βKitchen'),307 kitchen)308 living = Category.objects.get_or_create(309 name=_('Living Room'), parent=rooms)[0]310 cls.__upload(311 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βLiving Room'),312 living)313 nursery = Category.objects.get_or_create(314 name=_('Nursery'), parent=rooms)[0]315 cls.__upload(316 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βNursery'),317 nursery)318 office = Category.objects.get_or_create(319 name=_('Office'), parent=rooms)[0]320 cls.__upload(321 os.path.join(directory, 'Nouns/βCulture/βHousing/βRooms/βOffice'),322 office)323 # I.A.7324 learning = Category.objects.get_or_create(325 name=_('Learning'), parent=culture)[0]326 biology = Category.objects.get_or_create(327 name=_('Biology'), parent=learning)[0]328 animals = Category.objects.get_or_create(329 name=_('Animals'), parent=biology)[0]330 cls.__upload(331 os.path.join(directory, 'Nouns/βCulture/βLearning/βBiology/βAnimals'),332 animals)333 courses = Category.objects.get_or_create(334 name=_('Courses'), parent=learning)[0]335 cls.__upload(336 os.path.join(directory, 'Nouns/βCulture/βLearning/βCourses'), courses)337 nature = Category.objects.get_or_create(338 name=_('Nature'), parent=learning)[0]339 cls.__upload(340 os.path.join(directory, 'Nouns/βCulture/βLearning/βNature'), nature)341 writing = Category.objects.get_or_create(342 name=_('Writing'), parent=learning)[0]343 cls.__upload(344 os.path.join(directory, 'Nouns/βCulture/βLearning/βWriting'), writing)345 negatives = Category.objects.get_or_create(346 name=_('Negatives'), parent=learning)[0]347 cls.__upload(348 os.path.join(directory, 'Nouns/βCulture/βLearning/βNegatives'),349 negatives)350 # I.A.7.a351 math = Category.objects.get_or_create(352 name=_('Math'), parent=learning)[0]353 arithmetic = Category.objects.get_or_create(354 name=_('Arithmetic'), parent=math)[0]355 cls.__upload(356 os.path.join(directory, 'Nouns/βCulture/βLearning/βMath/βArithmetic'),357 arithmetic)358 counting = Category.objects.get_or_create(359 name=_('Counting'), parent=math)[0]360 cls.__upload(361 os.path.join(directory, 'Nouns/βCulture/βLearning/βMath/βCounting'),362 counting)363 geometry = Category.objects.get_or_create(364 name=_('Geometry'), parent=math)[0]365 cls.__upload(366 os.path.join(directory, 'Nouns/βCulture/βLearning/βMath/βGeometry'),367 geometry)368 measures = Category.objects.get_or_create(369 name=_('Measures'), parent=math)[0]370 cls.__upload(371 os.path.join(directory, 'Nouns/βCulture/βLearning/βMath/βMeasures'),372 measures)373 plot = Category.objects.get_or_create(name=_('Plot'), parent=math)[0]374 cls.__upload(375 os.path.join(directory, 'Nouns/βCulture/βLearning/βMath/βPlot'), plot)376 # I.A.7.b377 reading = Category.objects.get_or_create(378 name=_('Reading'), parent=learning)[0]379 generic = Category.objects.get_or_create(380 name=_('Generic'), parent=reading)[0]381 cls.__upload(382 os.path.join(directory, 'Nouns/βCulture/βLearning/βReading/βGeneric'),383 generic)384 negatives = Category.objects.get_or_create(385 name=_('Generic'), parent=learning)[0]386 cls.__upload(387 os.path.join(directory, 'Nouns/βCulture/βLearning/βReading/βNegatives'),388 negatives)389 # I.A.7.c390 school = Category.objects.get_or_create(391 name=_('School'), parent=learning)[0]392 generic = Category.objects.get_or_create(393 name=_('Generic'), parent=school)[0]394 cls.__upload(395 os.path.join(directory, 'Nouns/βCulture/βLearning/βSchool/βGeneric'),396 generic)397 negatives = Category.objects.get_or_create(398 name=_('Negatives'), parent=learning)[0]399 cls.__upload(400 os.path.join(directory, 'Nouns/βCulture/βLearning/βSchool/βNegatives'),401 negatives)402 # I.A.8403 playing = Category.objects.get_or_create(404 name=_('Playing'), parent=culture)[0]405 leisure = Category.objects.get_or_create(406 name=_('Leisure'), parent=playing)[0]407 cls.__upload(408 os.path.join(directory, 'Nouns/βCulture/βPlaying/βLeisure'), leisure)409 sports = Category.objects.get_or_create(410 name=_('Sports'), parent=playing)[0]411 cls.__upload(412 os.path.join(directory, 'Nouns/βCulture/βPlaying/βSports'), sports)413 negatives = Category.objects.get_or_create(414 name=_('Negatives'), parent=playing)[0]415 cls.__upload(416 os.path.join(directory, 'Nouns/βCulture/βPlaying/βNegatives'),417 negatives)418 # I.A.9419 praying = Category.objects.get_or_create(420 name=_('Praying'), parent=culture)[0]421 religion = Category.objects.get_or_create(422 name=_('Religion'), parent=praying)[0]423 generic = Category.objects.get_or_create(424 name=_('Generic'), parent=religion)[0]425 cls.__upload(426 os.path.join(directory, 'Nouns/βCulture/βPraying/βReligion/βGeneric'),427 generic)428 negatives = Category.objects.get_or_create(429 name=_('Negatives'), parent=religion)[0]430 cls.__upload(431 os.path.join(directory, 'Nouns/βCulture/βPraying/βReligion/βNegatives'),432 negatives)433 # I.A.10434 relating = Category.objects.get_or_create(435 name=_('Relating'), parent=culture)[0]436 negatives = Category.objects.get_or_create(437 name=_('Negatives'), parent=relating)[0]438 cls.__upload(439 os.path.join(directory, 'Nouns/βCulture/βRelating/βNegatives'),440 negatives)441 # I.A.10.a442 adults = Category.objects.get_or_create(443 name=_('Adults'), parent=relating)[0]444 generic = Category.objects.get_or_create(445 name=_('Generic'), parent=adults)[0]446 cls.__upload(447 os.path.join(directory, 'Nouns/βCulture/βRelating/βAdults/βGeneric'),448 generic)449 pairs = Category.objects.get_or_create(450 name=_('People in Pairs'), parent=adults)[0]451 cls.__upload(452 os.path.join(453 directory, 'Nouns/βCulture/βRelating/βAdults/βPeople in Pairs'),454 pairs)455 pregnancy = Category.objects.get_or_create(456 name=_('Pregnancy'), parent=adults)[0]457 cls.__upload(458 os.path.join(directory, 'Nouns/βCulture/βRelating/βAdults/βPregnancy'),459 pregnancy)460 sex_play = Category.objects.get_or_create(461 name=_('Sex Play'), parent=adults)[0]462 cls.__upload(463 os.path.join(directory, 'Nouns/βCulture/βRelating/βAdults/βSex Play'),464 sex_play)465 single = Category.objects.get_or_create(466 name=_('Single Person'), parent=adults)[0]467 cls.__upload(468 os.path.join(469 directory, 'Nouns/βCulture/βRelating/βAdults/βSingle Person'),470 single)471 # I.A.10.b472 children = Category.objects.get_or_create(473 name=_('Children'), parent=relating)[0]474 babies = Category.objects.get_or_create(475 name=_('Babies'), parent=children)[0]476 cls.__upload(477 os.path.join(directory, 'Nouns/βCulture/βRelating/βChildren/βBabies'),478 babies)479 minors = Category.objects.get_or_create(480 name=_('Minors'), parent=children)[0]481 cls.__upload(482 os.path.join(directory, 'Nouns/βCulture/βRelating/βChildren/βMinors'),483 minors)484 # I.A.10.b485 family = Category.objects.get_or_create(486 name=_('Family'), parent=relating)[0]487 extended = Category.objects.get_or_create(488 name=_('Extended'), parent=children)[0]489 cls.__upload(490 os.path.join(directory, 'Nouns/βCulture/βRelating/βFamily/βExtended'),491 extended)492 generations = Category.objects.get_or_create(493 name=_('Generations'), parent=children)[0]494 cls.__upload(495 os.path.join(496 directory, 'Nouns/βCulture/βRelating/βFamily/βGenerations'),497 generations)498 immediate = Category.objects.get_or_create(499 name=_('Immediate'), parent=children)[0]500 cls.__upload(501 os.path.join(directory, 'Nouns/βCulture/βRelating/βFamily/βImmediate'),502 immediate)503 pets = Category.objects.get_or_create(504 name=_('Pets'), parent=children)[0]505 cls.__upload(506 os.path.join(directory, 'Nouns/βCulture/βRelating/βFamily/βPets'), pets)507 step = Category.objects.get_or_create(508 name=_('Step'), parent=children)[0]509 cls.__upload(510 os.path.join(directory, 'Nouns/βCulture/βRelating/βFamily/βStep'), step)511 # I.A.11512 speaking = Category.objects.get_or_create(513 name=_('Speaking'), parent=culture)[0]514 greetings = Category.objects.get_or_create(515 name=_('Greetings'), parent=speaking)[0]516 cls.__upload(517 os.path.join(directory, 'Nouns/βCulture/βSpeaking/βGreetings'),518 greetings)519 voice = Category.objects.get_or_create(520 name=_('Voice'), parent=speaking)[0]521 cls.__upload(522 os.path.join(directory, 'Nouns/βCulture/βSpeaking/βVoice'), voice)523 negatives = Category.objects.get_or_create(524 name=_('Negatives'), parent=speaking)[0]525 cls.__upload(526 os.path.join(directory, 'Nouns/βCulture/βSpeaking/βNegatives'),527 negatives)528 # I.A.12529 spending = Category.objects.get_or_create(530 name=_('Spending'), parent=culture)[0]531 money = Category.objects.get_or_create(532 name=_('Money'), parent=spending)[0]533 cls.__upload(534 os.path.join(directory, 'Nouns/βCulture/βSpending/βMoney'), money)535 negatives = Category.objects.get_or_create(536 name=_('Negatives'), parent=spending)[0]537 cls.__upload(538 os.path.join(directory, 'Nouns/βCulture/βSpending/βNegatives'),539 negatives)540 # I.A.13541 thinking = Category.objects.get_or_create(542 name=_('Thinking'), parent=culture)[0]543 mind = Category.objects.get_or_create(544 name=_('Mind'), parent=thinking)[0]545 cls.__upload(546 os.path.join(directory, 'Nouns/βCulture/βThinking/βMind'), mind)547 negatives = Category.objects.get_or_create(548 name=_('Negatives'), parent=thinking)[0]549 cls.__upload(550 os.path.join(directory, 'Nouns/βCulture/βThinking/βNegatives'),551 negatives)552 # I.A.14553 traveling = Category.objects.get_or_create(554 name=_('Traveling'), parent=culture)[0]555 directions_maps = Category.objects.get_or_create(556 name=_('Directions Maps'), parent=traveling)[0]557 cls.__upload(558 os.path.join(directory, 'Nouns/βCulture/βTraveling/βDirections Maps'),559 directions_maps)560 transportation = Category.objects.get_or_create(561 name=_('Transportation'), parent=traveling)[0]562 cls.__upload(563 os.path.join(directory, 'Nouns/βCulture/βTraveling/βTransportation'),564 transportation)565 vacation = Category.objects.get_or_create(566 name=_('Vacation Trip'), parent=traveling)[0]567 cls.__upload(568 os.path.join(directory, 'Nouns/βCulture/βTraveling/βVacation Trip'),569 vacation)570 vehicle_upkeep = Category.objects.get_or_create(571 name=_('Vehicle Upkeep'), parent=traveling)[0]572 cls.__upload(573 os.path.join(directory, 'Nouns/βCulture/βTraveling/βVehicle Upkeep'),574 vehicle_upkeep)575 negatives = Category.objects.get_or_create(576 name=_('Negatives'), parent=traveling)[0]577 cls.__upload(578 os.path.join(directory, 'Nouns/βCulture/βTraveling/βNegatives'),579 negatives)580 # I.A.15581 wearing = Category.objects.get_or_create(582 name=_('Wearing'), parent=culture)[0]583 at_home = Category.objects.get_or_create(584 name=_('At Home'), parent=wearing)[0]585 cls.__upload(586 os.path.join(directory, 'Nouns/βCulture/βWearing/βAt Home'), at_home)587 dress_up = Category.objects.get_or_create(588 name=_('Dress-Up'), parent=wearing)[0]589 cls.__upload(590 os.path.join(directory, 'Nouns/βCulture/βWearing/βDress-Up'), dress_up)591 street_wear = Category.objects.get_or_create(592 name=_('Street Wear'), parent=wearing)[0]593 cls.__upload(594 os.path.join(directory, 'Nouns/βCulture/βWearing/βStreet Wear'),595 street_wear)596 negatives = Category.objects.get_or_create(597 name=_('Negatives'), parent=wearing)[0]598 cls.__upload(599 os.path.join(directory, 'Nouns/βCulture/βWearing/βNegatives'),600 negatives)601 # I.A.16602 working = Category.objects.get_or_create(603 name=_('Working'), parent=culture)[0]604 jobs = Category.objects.get_or_create(name=_('Jobs'), parent=working)[0]605 cls.__upload(606 os.path.join(directory, 'Nouns/βCulture/βWorking/βJobs'), jobs)607 # I.A.16.a608 work = Category.objects.get_or_create(name=_('Work'), parent=working)[0]609 generic = Category.objects.get_or_create(610 name=_('Generic'), parent=work)[0]611 cls.__upload(612 os.path.join(directory, 'Nouns/βCulture/βWorking/βWork/βGeneric'),613 generic)614 negatives = Category.objects.get_or_create(615 name=_('Negatives'), parent=working)[0]616 cls.__upload(617 os.path.join(directory, 'Nouns/βCulture/βWorking/βWork/βNegatives'),618 work)619 # II620 verbs = Category.objects.get_or_create(name=_('Verbs'))[0]621 modals = Category.objects.get_or_create(622 name=_('Modal Verbs'), parent=verbs)[0]623 cls.__upload(os.path.join(directory, 'Verbs/βModal Verbs'), modals)624 phrasal = Category.objects.get_or_create(625 name=_('Phrasal Verbs'), parent=verbs)[0]626 cls.__upload(os.path.join(directory, 'Verbs/βPhrasal Verbs'), phrasal)627 regular = Category.objects.get_or_create(628 name=_('Regular Verbs'), parent=verbs)[0]629 cls.__upload(os.path.join(directory, 'Verbs/βRegular Verbs'), regular)630 # II.A631 iv = Category.objects.get_or_create(632 name=_('Irregular Verbs'), parent=verbs)[0]633 iv_past = Category.objects.get_or_create(634 name=_('Past Tense'), parent=iv)[0]635 cls.__upload(636 os.path.join(directory, 'Verbs/βIrregular Verbs/βPast Tense'),637 iv_past)638 iv_present = Category.objects.get_or_create(639 name=_('Present Tense'), parent=iv)[0]640 cls.__upload(641 os.path.join(directory, 'Verbs/βIrregular Verbs/βPresent Tense'),642 iv_present)643 # III644 modifiers = Category.objects.get_or_create(name=_('Modifiers'))[0]645 # III.A646 adj = Category.objects.get_or_create(647 name=_('Adjectives'), parent=modifiers)[0]648 # III.A.1649 a_z = Category.objects.get_or_create(name=_('A-Z'), parent=adj)[0]650 cls.__upload(651 os.path.join(directory, 'Modifiers/βAdjectives/βA-Z'), a_z)652 # III.B653 adv = Category.objects.get_or_create(654 name=_('Adverbs'), parent=modifiers)[0]655 # III.B.1656 how = Category.objects.get_or_create(name=_('How'), parent=adv)[0]657 cls.__upload(os.path.join(directory, 'Modifiers/βAdverbs/βHow'), how)658 how_much = Category.objects.get_or_create(659 name=_('How Much'), parent=adv)[0]660 cls.__upload(661 os.path.join(directory, 'Modifiers/βAdverbs/βHow Much'), how_much)662 when = Category.objects.get_or_create(name=_('When'), parent=adv)[0]663 cls.__upload(os.path.join(directory, 'Modifiers/βAdverbs/βWhen'), when)664 where = Category.objects.get_or_create(name=_('Where'), parent=adv)[0]665 cls.__upload(os.path.join(directory, 'Modifiers/βAdverbs/βWhere'), where)666 # IV667 other = Category.objects.get_or_create(name=_('Other'))[0]668 # IV.A669 colors = Category.objects.get_or_create(670 name=_('Colors'), parent=other)[0]671 cls.__upload(os.path.join(directory, 'Other/βColors'), colors)672 # IV.B673 connectives = Category.objects.get_or_create(674 name=_('Connectives'), parent=other)[0]675 cls.__upload(os.path.join(directory, 'Other/βConnectives'), connectives)676 # IV.C677 counting = Category.objects.get_or_create(678 name=_('Counting'), parent=other)[0]679 # IV.C.1680 numbers = Category.objects.get_or_create(681 name=_('Numbers'), parent=counting)[0]682 cardinal = Category.objects.get_or_create(683 name=_('Cardinal'), parent=numbers)[0]684 cls.__upload(685 os.path.join(directory, 'Other/βCounting/βNumbers/βCardinal'),686 cardinal)687 fractional = Category.objects.get_or_create(688 name=_('Fractional'), parent=numbers)[0]689 cls.__upload(690 os.path.join(directory, 'Other/βCounting/βNumbers/βFractional'),691 fractional)692 ordinal = Category.objects.get_or_create(693 name=_('Ordinal'), parent=numbers)[0]694 cls.__upload(695 os.path.join(directory, 'Other/βCounting/βNumbers/βOrdinal'), ordinal)696 # IV.C.2697 time = Category.objects.get_or_create(698 name=_('Time'), parent=counting)[0]699 analog = Category.objects.get_or_create(700 name=_('Analog'), parent=time)[0]701 cls.__upload(702 os.path.join(directory, 'Other/βCounting/βTime/βAnalog'), analog)703 calendar = Category.objects.get_or_create(704 name=_('Calendar'), parent=time)[0]705 cls.__upload(706 os.path.join(directory, 'Other/βCounting/βTime/βCalendar'), calendar)707 day_night = Category.objects.get_or_create(708 name=_('Day & Night'), parent=time)[0]709 cls.__upload(710 os.path.join(directory, 'Other/βCounting/βTime/βDay & Night'),711 day_night)712 digital = Category.objects.get_or_create(713 name=_('Digital'), parent=time)[0]714 cls.__upload(715 os.path.join(directory, 'Other/βCounting/βTime/βDigital'), digital)716 hours = Category.objects.get_or_create(name=_('Hours'), parent=time)[0]717 cls.__upload(718 os.path.join(directory, 'Other/βCounting/βTime/βHours'), hours)719 weekdays = Category.objects.get_or_create(720 name=_('Weekdays'), parent=time)[0]721 cls.__upload(722 os.path.join(directory, 'Other/βCounting/βTime/βWeekdays'), weekdays)723 # IV.D724 flags_languages = Category.objects.get_or_create(725 name=_('Flags & Languages'), parent=other)[0]726 flags = Category.objects.get_or_create(727 name=_('Flags'), parent=flags_languages)[0]728 cls.__upload(729 os.path.join(directory, 'Other/βFlags & Languages/βFlags'), flags)730 _global = Category.objects.get_or_create(731 name=_('Global Icons'), parent=flags_languages)[0]732 cls.__upload(733 os.path.join(directory, 'Other/βFlags & Languages/βGlobal Icons'),734 _global)735 # IV.E736 prepositions = Category.objects.get_or_create(737 name=_('Prepositions'), parent=other)[0]738 cls.__upload(739 os.path.join(directory, 'Other/βPrepositions'), prepositions)740 # IV.F741 pronouns = Category.objects.get_or_create(742 name=_('Pronouns'), parent=other)[0]743 contractions = Category.objects.get_or_create(744 name=_('Contractions'), parent=pronouns)[0]745 cls.__upload(746 os.path.join(directory, 'Other/βPronouns/βContractions'),747 contractions)748 indefinite = Category.objects.get_or_create(749 name=_('Indefinite'), parent=pronouns)[0]750 cls.__upload(751 os.path.join(directory, 'Other/βPronouns/βIndefinite'), indefinite)752 personal = Category.objects.get_or_create(753 name=_('Personal'), parent=pronouns)[0]754 cls.__upload(755 os.path.join(directory, 'Other/βPronouns/βPersonal'), personal)756 # IV.G757 punctuation = Category.objects.get_or_create(758 name=_('Punctuation'), parent=other)[0]759 cls.__upload(os.path.join(directory, 'Other/βPunctuation'), punctuation)760 # IV.H761 titles_labels = Category.objects.get_or_create(762 name=_('Titles & Labels'), parent=other)[0]763 cls.__upload(...
init_alerte_table.py
Source:init_alerte_table.py
...5from components.traffic_alert.models import TrafficAlert6class Command(BaseCommand):7 help = "export database"8 def handle(self, *args, **kwargs):9 inst_at = AlertTable.objects.get_or_create(10 category="Information", alert_type="Manifestation", alert_subtype="Mariage"11 )12 AlertTable.objects.get_or_create(category="Information", alert_type="Manifestation", alert_subtype="Manzaraka")13 AlertTable.objects.get_or_create(category="Information", alert_type="Manifestation", alert_subtype="Marche")14 AlertTable.objects.get_or_create(category="Information", alert_type="Manifestation", alert_subtype="GrΓΒ¨ve")15 AlertTable.objects.get_or_create(16 category="Information", alert_type="Signalisation", alert_subtype="Feux temporaire"17 )18 AlertTable.objects.get_or_create(category="Information", alert_type="Signalisation", alert_subtype="Dos d'ΓΒ’ne")19 AlertTable.objects.get_or_create(category="Information", alert_type="ChaussΓΒ©e", alert_subtype="Nid de poule")20 AlertTable.objects.get_or_create(21 category="Information", alert_type="ChaussΓΒ©e", alert_subtype="Arbre sur la chaussΓΒ©e"22 )23 AlertTable.objects.get_or_create(category="Information", alert_type="ChaussΓΒ©e", alert_subtype="Gravillon")24 AlertTable.objects.get_or_create(category="Information", alert_type="ChaussΓΒ©e", alert_subtype="Route barrΓΒ©e")25 AlertTable.objects.get_or_create(category="Danger", alert_type="Agression", alert_subtype="Caillassage")26 AlertTable.objects.get_or_create(category="Danger", alert_type="Accident", alert_subtype="Accident")27 AlertTable.objects.get_or_create(28 category="Danger", alert_type="Travaux", alert_subtype="Travaux sur la chaussΓΒ©e"29 )30 inst_loc = Localisation.objects.get_or_create(city="KawΓΒ©ni", municipality="Mamoudzou", postalcode="")31 Localisation.objects.get_or_create(city="MtsapΓΒ©rΓΒ©", municipality="Mamoudzou", postalcode="")32 Localisation.objects.get_or_create(city="Kavani", municipality="Mamoudzou", postalcode="")33 Localisation.objects.get_or_create(city="Passamainty", municipality="Mamoudzou", postalcode="")34 Localisation.objects.get_or_create(city="Mamoudzou", municipality="Mamoudzou", postalcode="")35 Localisation.objects.get_or_create(city="VahibΓΒ©", municipality="Mamoudzou", postalcode="")36 Localisation.objects.get_or_create(city="Tsoundzou 1", municipality="Mamoudzou", postalcode="")37 Localisation.objects.get_or_create(city="Tsoundzou 2", municipality="Mamoudzou", postalcode="")38 Localisation.objects.get_or_create(city="Majicavi-Koropa", municipality="Koungou", postalcode="")39 Localisation.objects.get_or_create(city="Koungou", municipality="Koungou", postalcode="")40 Localisation.objects.get_or_create(city="Longoni", municipality="Koungou", postalcode="")41 Localisation.objects.get_or_create(city="TrΓΒ©vani", municipality="Koungou", postalcode="")42 Localisation.objects.get_or_create(city="Majicavo Lamir", municipality="Koungou", postalcode="")43 Localisation.objects.get_or_create(city="Kangani", municipality="Koungou", postalcode="")44 Localisation.objects.get_or_create(city="Dzaoudzi", municipality="Labattoir", postalcode="")45 Localisation.objects.get_or_create(city="Labattoir", municipality="Labattoir", postalcode="")46 Localisation.objects.get_or_create(city="Tsararano", municipality="DembΓΒ©ni", postalcode="")47 Localisation.objects.get_or_create(city="DembΓΒ©ni", municipality="DembΓΒ©ni", postalcode="")48 Localisation.objects.get_or_create(city="Iloni", municipality="DembΓΒ©ni", postalcode="")49 Localisation.objects.get_or_create(city="Hajangoua", municipality="DembΓΒ©ni", postalcode="")50 Localisation.objects.get_or_create(city="Ongojou", municipality="DembΓΒ©ni", postalcode="")51 Localisation.objects.get_or_create(city="Combani", municipality="Tsingoni", postalcode="")52 Localisation.objects.get_or_create(city="Tsingoni", municipality="Tsingoni", postalcode="")53 Localisation.objects.get_or_create(city="MirΓΒ©rΓΒ©ni", municipality="Tsingoni", postalcode="")54 Localisation.objects.get_or_create(city="MroalΓΒ©", municipality="Tsingoni", postalcode="")55 Localisation.objects.get_or_create(city="Pamandzi", municipality="Pamandzi", postalcode="")56 Localisation.objects.get_or_create(city="DzoumognΓΒ©", municipality="Bandraboua", postalcode="")57 Localisation.objects.get_or_create(city="Bandraboua", municipality="Bandraboua", postalcode="")58 Localisation.objects.get_or_create(city="Handrema", municipality="Bandraboua", postalcode="")59 Localisation.objects.get_or_create(city="Bouyouni", municipality="Bandraboua", postalcode="")60 Localisation.objects.get_or_create(city="Mtsangamboua", municipality="Bandraboua", postalcode="")61 Localisation.objects.get_or_create(city="Sada", municipality="Sada", postalcode="")62 Localisation.objects.get_or_create(city="Mangajou", municipality="Sada", postalcode="")63 Localisation.objects.get_or_create(city="Mtsamboro", municipality="Mtsamboro", postalcode="")64 Localisation.objects.get_or_create(city="Mtsahara", municipality="Mtsamboro", postalcode="")65 Localisation.objects.get_or_create(city="Hamjago", municipality="Mtsamboro", postalcode="")66 Localisation.objects.get_or_create(city="BandrΓΒ©lΓΒ©", municipality="BandrΓΒ©lΓΒ©", postalcode="")67 Localisation.objects.get_or_create(city="Mtsamoudou", municipality="BandrΓΒ©lΓΒ©", postalcode="")68 Localisation.objects.get_or_create(city="Nyambadao", municipality="BandrΓΒ©lΓΒ©", postalcode="")69 Localisation.objects.get_or_create(city="Dapani", municipality="BandrΓΒ©lΓΒ©", postalcode="")70 Localisation.objects.get_or_create(city="Hamouro", municipality="BandrΓΒ©lΓΒ©", postalcode="")71 Localisation.objects.get_or_create(city="Bambo-Est", municipality="BandrΓΒ©lΓΒ©", postalcode="")72 Localisation.objects.get_or_create(city="Poroani", municipality="Chirongui", postalcode="")73 Localisation.objects.get_or_create(city="Tsimkoura", municipality="Chirongui", postalcode="")74 Localisation.objects.get_or_create(city="Chirongui", municipality="Chirongui", postalcode="")75 Localisation.objects.get_or_create(city="MirΓΒ©rΓΒ©ni", municipality="Chirongui", postalcode="")76 Localisation.objects.get_or_create(city="Mramadoudou", municipality="Chirongui", postalcode="")77 Localisation.objects.get_or_create(city="Malamani", municipality="Chirongui", postalcode="")78 Localisation.objects.get_or_create(city="Ouangani", municipality="Ouangani", postalcode="")79 Localisation.objects.get_or_create(city="Barakani", municipality="Ouangani", postalcode="")80 Localisation.objects.get_or_create(city="Kahani", municipality="Ouangani", postalcode="")81 Localisation.objects.get_or_create(city="Coconi", municipality="Ouangani", postalcode="")82 Localisation.objects.get_or_create(city="BouΓΒ©ni", municipality="BouΓΒ©ni", postalcode="")83 Localisation.objects.get_or_create(city="Mzouazia", municipality="BouΓΒ©ni", postalcode="")84 Localisation.objects.get_or_create(city="Moinatrindri", municipality="BouΓΒ©ni", postalcode="")85 Localisation.objects.get_or_create(city="Hagnoundrou", municipality="BouΓΒ©ni", postalcode="")86 Localisation.objects.get_or_create(city="Bambo-Ouest", municipality="BouΓΒ©ni", postalcode="")87 Localisation.objects.get_or_create(city="Mbouanatsa", municipality="BouΓΒ©ni", postalcode="")88 Localisation.objects.get_or_create(city="M'tsangamouji", municipality="M'tsangamouji", postalcode="")89 Localisation.objects.get_or_create(city="ChembΓΒ©nyoumba", municipality="M'tsangamouji", postalcode="")90 Localisation.objects.get_or_create(city="Mliha", municipality="M'tsangamouji", postalcode="")91 Localisation.objects.get_or_create(city="Acoua", municipality="Acoua", postalcode="")92 Localisation.objects.get_or_create(city="Mtsangadoua", municipality="Acoua", postalcode="")93 Localisation.objects.get_or_create(city="Kani-KΓΒ©li", municipality="Kani-KΓΒ©li", postalcode="")94 Localisation.objects.get_or_create(city="Choungui", municipality="Kani-KΓΒ©li", postalcode="")95 Localisation.objects.get_or_create(city="KanibΓΒ©", municipality="Kani-KΓΒ©li", postalcode="")96 Localisation.objects.get_or_create(city="Mbouini", municipality="Kani-KΓΒ©li", postalcode="")97 Localisation.objects.get_or_create(city="MronabΓΒ©ja", municipality="Kani-KΓΒ©li", postalcode="")98 Localisation.objects.get_or_create(city="Passy-KΓΒ©li", municipality="Kani-KΓΒ©li", postalcode="")99 TrafficAlert.objects.get_or_create(100 lat=-12.84872320,101 lon=45.11295290,102 alert_id=inst_at[0],103 localisation_id=inst_loc[0],104 localisation_description="test localisation description",105 report_description="test report description",...
initcurriculum.py
Source:initcurriculum.py
...22 to be wiped because of problems in the migrations.23 """24 help = 'Initialize the curriculum'25 def handle(self, *args, **options):26 mba, created = Course.objects.get_or_create(27 short_name='MBA', long_name='Master of Business Administration')28 bba, created = Course.objects.get_or_create(29 short_name='BBA', long_name='Bachelor of Business Administration')30 bca, created = Course.objects.get_or_create(31 short_name='BCA', long_name='Bachelor of Computer Applications')32 # MBA33 mba_2, created = Semester.objects.get_or_create(34 course=mba, semester_number=2)35 mba_4 = Semester.objects.get_or_create(36 course=mba, semester_number=4)37 # BBA38 bba_2, created = Semester.objects.get_or_create(course=bba, semester_number=2)39 bba_4, created = Semester.objects.get_or_create(40 course=bba, semester_number=4)41 bba_6, created = Semester.objects.get_or_create(42 course=bba, semester_number=6)43 # BCA44 bca_2, created = Semester.objects.get_or_create(45 course=bca, semester_number=2)46 bca_4, created = Semester.objects.get_or_create(47 course=bca, semester_number=4)48 bca_6, created = Semester.objects.get_or_create(49 course=bca, semester_number=6)50 # Subject51 # BBA VI52 Subject.objects.get_or_create(53 name='Strat. Mgmt.', semester=bba_6, is_university_subject=True)54 Subject.objects.get_or_create(55 name='Ent. Devp.', semester=bba_6, is_university_subject=True)56 Subject.objects.get_or_create(57 name='T & D', semester=bba_6, is_university_subject=True)58 Subject.objects.get_or_create(59 name='Bus. Tax & Audit', semester=bba_6, is_university_subject=True)60 Subject.objects.get_or_create(61 name='Cons. Behaviour', semester=bba_6, is_university_subject=True)62 Subject.objects.get_or_create(63 name='IR & LL', semester=bba_6, is_university_subject=True)64 Subject.objects.get_or_create(65 name='Bank. & Finance', semester=bba_6, is_university_subject=True)66 Subject.objects.get_or_create(67 name='Advt. & MM', semester=bba_6, is_university_subject=True)68 # BBA IV69 Subject.objects.get_or_create(70 name='B.Eco', semester=bba_4, is_university_subject=True)71 Subject.objects.get_or_create(72 name='OB-II', semester=bba_4, is_university_subject=True)73 Subject.objects.get_or_create(74 name='B.Envt', semester=bba_4, is_university_subject=True)75 Subject.objects.get_or_create(76 name='Cost & Mgmt a/βc', semester=bba_4, is_university_subject=True)77 Subject.objects.get_or_create(78 name='Lead. Skills', semester=bba_4, is_university_subject=False)79 Subject.objects.get_or_create(80 name='Prod. & OP', semester=bba_4, is_university_subject=True)81 Subject.objects.get_or_create(82 name='Advanced Excel', semester=bba_4, is_university_subject=True)83 # BBA II84 Subject.objects.get_or_create(85 name='MM-I', semester=bba_2, is_university_subject=True)86 Subject.objects.get_or_create(87 name='B.Statistics', semester=bba_2, is_university_subject=True)88 Subject.objects.get_or_create(89 name='Comm. Skills', semester=bba_2, is_university_subject=True)90 Subject.objects.get_or_create(91 name='FA', semester=bba_2, is_university_subject=True)92 Subject.objects.get_or_create(93 name='EVS', semester=bba_2, is_university_subject=True)94 Subject.objects.get_or_create(95 name='B. Economics', semester=bba_2, is_university_subject=True)96 # BCA II97 Subject.objects.get_or_create(98 name='OS', semester=bca_2, is_university_subject=True)99 Subject.objects.get_or_create(100 name='Comm. Skills', semester=bca_2, is_university_subject=True)101 Subject.objects.get_or_create(102 name='SSAD', semester=bca_2, is_university_subject=True)103 Subject.objects.get_or_create(104 name='PPM-I', semester=bca_2, is_university_subject=True)105 Subject.objects.get_or_create(106 name='AWD', semester=bca_2, is_university_subject=True)107 Subject.objects.get_or_create(108 name='Prac. AWD', semester=bca_2, is_university_subject=True)109 # BCA IV110 Subject.objects.get_or_create(111 name='Java', semester=bca_4, is_university_subject=True)112 Subject.objects.get_or_create(113 name='Prac. Java', semester=bca_4, is_university_subject=True)114 Subject.objects.get_or_create(115 name='Oracle', semester=bca_4, is_university_subject=True)116 Subject.objects.get_or_create(117 name='Prac. Oracle', semester=bca_4, is_university_subject=True)118 Subject.objects.get_or_create(119 name='EVS', semester=bca_4, is_university_subject=True)120 Subject.objects.get_or_create(121 name='BA', semester=bca_4, is_university_subject=True)122 # BCA VI123 Subject.objects.get_or_create(124 name='ASP.NET', semester=bca_6, is_university_subject=True)125 Subject.objects.get_or_create(126 name='UML', semester=bca_6, is_university_subject=True)127 Subject.objects.get_or_create(128 name='E-Commerce', semester=bca_6, is_university_subject=True)129 Subject.objects.get_or_create(130 name='OB', semester=bca_6, is_university_subject=True)131 Subject.objects.get_or_create(...
create_initial_data.py
Source:create_initial_data.py
...7setup_environ(settings)8from ratestreets.models import *9admin_user = User.objects.get(username='smooney')10rater_user = User.objects.get(username='rater')11module = Module.objects.get_or_create(description='Sample Varied Questions Module')[0]12bike_only_module = Module.objects.get_or_create(description='Sample Bike-Only Module')[0]13# Can take this out once the import script can import Kathy's spreadsheet in a meaningful way.14#count_rating_type = RatingType.objects.get_or_create(description='count', storage_type='CATEGORY')[0]15#for index in range(10):16# count_category = Category.objects.get_or_create(name=index,description=index, db_value=index)[0]17# count_rating_type.values.add(count_category)18#count_category = Category.objects.get_or_create(name='10 or more',description='10 or more', db_value=10)[0]19#count_rating_type.values.add(count_category)20#21#text_rating_type = RatingType.objects.get_or_create(description='free-form text', storage_type='TEXT')[0]22#yesno_rating_type = RatingType.objects.get_or_create(description='yes/βno', storage_type='CATEGORY')[0]23#yes_category = Category.objects.get_or_create(name='yes',description='yes', db_value=0)[0]24#no_category = Category.objects.get_or_create(name='no',description='no', db_value=1)[0]25#yesno_rating_type.values.add(yes_category)26#yesno_rating_type.values.add(no_category)27#28#sometonone_rating_type = RatingType.objects.get_or_create(description='some or a lot/βfew/βnone', storage_type='CATEGORY')[0]29#some_category = Category.objects.get_or_create(name='some or a lot',description='some or a lot', db_value=0)[0]30#few_category = Category.objects.get_or_create(name='few',description='few', db_value=1)[0]31#none_category = Category.objects.get_or_create(name='none',description='none', db_value=2)[0]32#sometonone_rating_type.values.add(some_category)33#sometonone_rating_type.values.add(few_category)34#sometonone_rating_type.values.add(none_category)35#36#interesting_rating_type = RatingType.objects.get_or_create(description='interestingness', storage_type='CATEGORY')[0]37#interesting_category = Category.objects.get_or_create(name='interesting',description='interesting', db_value=2)[0]38#somewhat_interesting_category = Category.objects.get_or_create(name='somewhat interesting',description='somewhat interesting', db_value=1)[0]39#uninteresting_category = Category.objects.get_or_create(name='uninteresting',description='uninteresting', db_value=0)[0]40#interesting_rating_type.values.add(interesting_category)41#interesting_rating_type.values.add(somewhat_interesting_category)42#interesting_rating_type.values.add(uninteresting_category)43#44#45#Item.objects.get_or_create(name='activity-complexity', description='How many people are on your side of the street?', rating_type=count_rating_type)46#Item.objects.get_or_create(name='aesthetics-architecture', description='How interesting is the architecture?', rating_type=interesting_rating_type)47#Item.objects.get_or_create(name='amenities-dining', description='Are there outdoor dining establishments?', rating_type=sometonone_rating_type)48#Item.objects.get_or_create(name='bicycle-bike lane', description='Are there bike lanes', rating_type=yesno_rating_type)49##Item.objects.get_or_create(name='more information', description='Is there anything else to say about this street?', rating_type=text_rating_type)50#51#items = Item.objects.all()52#for index in range(items.count()):53# module.items.add(items[index])54# Pick the first module, which should be our default spreadsheet items.55module = Module.objects.all()[0]56study = Study.objects.get_or_create(director=admin_user, name='Study #1 (Everything)', description='Simple Test Study')[0]57study.modules.add(module)58study.raters.add(rater_user)59study.managers.add(admin_user)60#bike_only_module.items.add(items[3])61#bike_only_study = Study.objects.get_or_create(director=admin_user, name='Study #2 (Bikes Only)', description='Bike-only Study')[0]62#bike_only_study.modules.add(bike_only_module)63#bike_only_study.raters.add(rater_user)64#bike_only_study.managers.add(admin_user)65segment_1 = Segment.objects.get_or_create(study=study, point_of_view=0, start_lat=40.74781, start_lng=-73.980812, end_lat=40.74781, end_lng=-73.980812)[0]66segment_2 = Segment.objects.get_or_create(study=study, point_of_view=0, start_lat=41.657984, start_lng=-81.455401, end_lat=41.657984, end_lng=-81.455401)[0]67segment_3 = Segment.objects.get_or_create(study=study, point_of_view=0, start_lat=42.402091, start_lng=-71.145142, end_lat=42.402091, end_lng=-71.145142)[0]68segment_4 = Segment.objects.get_or_create(study=study, point_of_view=0, start_lat=41.878355, start_lng=-87.686341, end_lat=41.878355, end_lng=-87.686341)[0]69segment_5 = Segment.objects.get_or_create(study=study, point_of_view=0, start_lat=29.919239, start_lng=-90.112968, end_lat=29.919239, end_lng=-90.112968)[0]70task_1 = RatingTask.objects.get_or_create(user=rater_user, segment=segment_1, module=module)71task_2 = RatingTask.objects.get_or_create(user=rater_user, segment=segment_2, module=module)72task_3 = RatingTask.objects.get_or_create(user=rater_user, segment=segment_3, module=module)73task_4 = RatingTask.objects.get_or_create(user=rater_user, segment=segment_4, module=module)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!