# Path: micro_blog/models.py
# class Category(models.Model):
#     name = models.CharField(max_length=50, unique=True)
#     slug = models.CharField(max_length=50, unique=True)
#     description = models.CharField(max_length=500)
#     is_display = models.BooleanField(default=False)
#     min_published_blogs = models.IntegerField()
#     max_published_blogs = models.IntegerField()
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         super(Category, self).save(*args, **kwargs)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name
# 
#     @property
#     def get_url(self):
#         return settings.SITE_BLOG_URL + "category/" + self.slug
# 
#     def get_blog_posts(self):
#         return Post.objects.filter(category=self, status='P')
# 
#     def no_of_blog_posts(self):
#         return Post.objects.filter(category=self).count()
# 
# class Country(models.Model):
#     name = models.CharField(max_length=50, unique=True)
#     code = models.CharField(max_length=50)
#     slug = models.CharField(max_length=50, unique=True)
# 
#     def __str__(self):
#         return self.name


from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from micro_blog.models import Category, Country
from django.contrib.postgres.fields import ArrayField, JSONField
import json
        menus = Menu.objects.filter(parent=menu[0].parent, status='on')
        return menus

    def __unicode__(self):
        return self.title


class Contact(models.Model):

    ENQUERY_TYPES = (
                    ('general', 'Request For Services'),
                    ('partnership', 'Partnership Queries'),
                    ('media', 'Media Queries'),
                    ('general queries', 'General Queries'),
                    ('feedback', 'Website Feedback'),
                    ('others', 'Others'),
                    )

    domain = models.CharField(max_length=100, null=True, blank=True)
    domain_url = models.URLField(max_length=200, null=True, blank=True)
    country = models.CharField(max_length=100)
    enquery_type = models.CharField(max_length=100, choices=ENQUERY_TYPES)

    # def __unicode__(self):
    #     return self.contact_info.full_name


class Menu(models.Model):
    parent = models.ForeignKey('self', blank=True, null=True)
    title = models.CharField(max_length=255)

# Path: micro_blog/models.py
# class Category(models.Model):
#     name = models.CharField(max_length=50, unique=True)
#     slug = models.CharField(max_length=50, unique=True)
#     description = models.CharField(max_length=500)
#     is_display = models.BooleanField(default=False)
#     min_published_blogs = models.IntegerField()
#     max_published_blogs = models.IntegerField()
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         super(Category, self).save(*args, **kwargs)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name
# 
#     @property
#     def get_url(self):
#         return settings.SITE_BLOG_URL + "category/" + self.slug
# 
#     def get_blog_posts(self):
#         return Post.objects.filter(category=self, status='P')
# 
#     def no_of_blog_posts(self):
#         return Post.objects.filter(category=self).count()
# 
# class Country(models.Model):
#     name = models.CharField(max_length=50, unique=True)
#     code = models.CharField(max_length=50)
#     slug = models.CharField(max_length=50, unique=True)
# 
#     def __str__(self):
#         return self.name


# Path: pages/models.py
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from micro_blog.models import Category, Country
from django.contrib.postgres.fields import ArrayField, JSONField
import json

        menus = Menu.objects.filter(parent=menu[0].parent, status='on')
        return menus

    def __unicode__(self):
        return self.title


class Contact(models.Model):

    ENQUERY_TYPES = (
                    ('general', 'Request For Services'),
                    ('partnership', 'Partnership Queries'),
                    ('media', 'Media Queries'),
                    ('general queries', 'General Queries'),
                    ('feedback', 'Website Feedback'),
                    ('others', 'Others'),
                    )

    domain = models.CharField(max_length=100, null=True, blank=True)
    domain_url = models.URLField(max_length=200, null=True, blank=True)
    country = models.CharField(max_length=100)
    enquery_type = models.CharField(max_length=100, choices=ENQUERY_TYPES)

    # def __unicode__(self):
    #     return self.contact_info.full_name


class Menu(models.Model):
    parent = models.ForeignKey('self', blank=True, null=True)
    title = models.CharField(max_length=255)

    country = models.ForeignKey(Country, blank=True, null=True)