# image create view
if form.is_valid():
images = Image.objects.order_by('-_id').all()
if len(images)>0:
# get latest image scene number
scene_number = Images.first().scene_number + 1
# creating first image so set scene_number =1
scene_number = 1
View image_edit.js
# add this js file /static/js/image_edit.js
var width = window.innerWidth;
var height = window.innerHeight;
function update(activeAnchor) {
var group = activeAnchor.getParent();
var topLeft = group.get('.topLeft')[0];
View template.html
<!DOCTYPE html>
<meta charset="utf-8">
{% for image in object_list %}
# convert image and video fields to StringField() in
# remove type field from and as well
# changes
# create_image view
image =
image_file = request.FILES['image']
View company_profile.json
"id": 1,
"name": "Meri Company",
"street": "",
"city": "",
"state": "",
"country": "",
"lat": "0.00000000000000000000",
"lng": "0.00000000000000000000",
"site_url": "",
from mongoengine import EmbeddedDocument, Document, CASCADE
from mongoengine import fields
import binascii
import os
from django.utils import timezone
from rest_framework_mongoengine import generics
from rest_framework.response import Response
from .serializers import LoginSerializer
from configuration.models import User
#from captive_portal.models import SessionHistory, Voucher
from .models import SessionHistory
from rest_framework import serializers
class SessionHistoryCreateSerializer(DocumentSerializer):
class Meta:
model = SessionHistory
fields = '__all__'
# check date...
def validate(self, data):
data = super().validate(data)
class SocialLoginSerializer(UserDeviceMixin, serializers.Serializer):
PROVIDER_CHOICES = Provider.objects.values_list('name')
# first_name = serializers.CharField(required=False, allow_blank=True)
# last_name = serializers.CharField(required=False, allow_blank=True)
# email = serializers.EmailField()
# mac_address = serializers.CharField()
name = serializers.CharField(required=False, allow_blank=True)
View fields.xml
field names