-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from SmartWasteSegregatorAndRoutePlanner/imple…
…ment-djikstras-algorithm Implement djikstras algorithm
- Loading branch information
Showing
12 changed files
with
1,266 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"gitlens.telemetry.enabled": false, | ||
"code-runner.enableAppInsights": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from django.contrib import admin | ||
from .models import GarbageBinLocation | ||
|
||
# Register your models here. | ||
admin.site.register(GarbageBinLocation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
class GarbageBinLocation(models.Model): | ||
name = models.CharField(max_length=50) | ||
garbage_weight = models.FloatField(default=0) | ||
latitude = models.FloatField(default=19.2991243) | ||
longitude = models.FloatField(default=72.8780597) | ||
added_on = models.DateTimeField(auto_now_add=True) | ||
updated_on = models.DateField(auto_now=True) | ||
|
||
def __str__(self) -> str: | ||
return str(self.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from rest_framework import serializers | ||
from .models import GarbageBinLocation | ||
|
||
class GarbageBinLocationSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = GarbageBinLocation | ||
fields = ['name', 'garbage_weight', 'latitude', 'longitude'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
from django.urls import path | ||
from .views import MapView | ||
from django.urls import path, include | ||
from rest_framework.routers import DefaultRouter | ||
|
||
from .views import MapViewSet, update_routes_data | ||
|
||
router = DefaultRouter() | ||
router.register(r'', MapViewSet, basename='route-planner') | ||
|
||
|
||
urlpatterns = [ | ||
path('', MapView.as_view(), name='route-planner'), | ||
path('', include(router.urls)), | ||
path('update-routes', update_routes_data) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.