class AnswerMetaData(ActivityTracking):
    META_DATA_VALUE_TYPE = (
        ('1', _('Not Required')),
        ('2', _('Min')),
        ('3', _('Max')),
    )

    answer = models.ForeignKey('quiz.Answer',
                               related_name='answer_meta_data',
                               on_delete=models.CASCADE)
    name = models.CharField(max_length=255,
                            help_text=_('Answer meta data name'),
                            verbose_name=_('Answer meta data name'))
    value = models.CharField(max_length=255,
                             help_text=_('Answer meta data value'),
                             verbose_name=_('Answer meta data value'))
    value_type = models.CharField(
        max_length=128,
        choices=META_DATA_VALUE_TYPE,
        help_text=_('Answer meta data value type'),
        verbose_name=_('Answer meta data value type'),
        null=True,
        blank=True)

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Answer Meta Data")
        verbose_name_plural = _("Answer Meta Data")
        ordering = ['-created_at']
Beispiel #2
0
class Logs(ActivityTracking):
    LOG_TYPES = (
        ('DEBUG', _('DEBUG')),
        ('INFO', _('INFO')),
        ('WARNING', _('WARNING')),
        ('ERROR', _('ERROR')),
    )

    log_module = models.ForeignKey('home.LogModule',
                                   related_name='log_module',
                                   on_delete=models.CASCADE)
    log_type = models.CharField(max_length=128,
                                choices=LOG_TYPES,
                                help_text=_('Log Type'),
                                verbose_name=_('Log Type'),
                                default='Error',
                                null=True,
                                blank=True)
    message = models.TextField(blank=True,
                               null=True,
                               help_text=_('Error Message'),
                               verbose_name=_('Error Message'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return f"{self.log_module.name} - {self.log_type}"

    class Meta:
        verbose_name = _("Logs")
        verbose_name_plural = _("Logs")
        ordering = ['-created_at']
class Answer(ActivityTracking):
    question = models.ForeignKey('quiz.Question',
                                 related_name='question',
                                 on_delete=models.CASCADE)
    name = models.CharField(max_length=255,
                            help_text=_('Answer name'),
                            verbose_name=_('Answer name'))
    value = models.CharField(max_length=255,
                             help_text=_('Answer value'),
                             verbose_name=_('Answer value'))
    short_description = models.CharField(
        max_length=150,
        help_text=_('Answer short description'),
        verbose_name=_('Answer short description'))
    long_description = models.CharField(
        max_length=300,
        help_text=_('Answer long description'),
        verbose_name=_('Answer long description'))
    order = models.IntegerField(help_text=_('Answer order'),
                                verbose_name=_('Answer order'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Answer")
        verbose_name_plural = _("Answers")
        ordering = ['-created_at']
class OfferAspectsMetaData(ActivityTracking):
    ASPECT_TYPE = (
        ('1', _('Closed')),
        ('2', _('Open')),
    )

    ASPECT_INPUT_TYPE = (
        ('1', _('Single')),
        ('2', _('Multi')),
    )

    name = models.CharField(max_length=255,
                help_text=_('Offer Aspect name'), 
                verbose_name=_('Offer Aspect name'))
    aspect_type = models.CharField(max_length=128,
                choices=ASPECT_TYPE,
                help_text=_('Offer Aspect meta data type'),
                verbose_name=_('Offer Aspect meta data type'),
                null=True, blank=True)
    aspect_input_type = models.CharField(max_length=128,
                choices=ASPECT_INPUT_TYPE,
                help_text=_('Offer Aspect meta data input type'),
                verbose_name=_('Offer Aspect meta data input type'),
                null=True, blank=True)
    
    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Offer Aspects Meta Data")
        verbose_name_plural = _("Offer Aspects Meta Data")
        ordering = ['-created_at']
class OfferAspectValuesMetaData(ActivityTracking):
    VALUE_TYPE = (
        ('1', _('Text')),
        ('2', _('Number')),
    )

    aspect_meta_data = models.ForeignKey('offer.OfferAspectsMetaData',
                related_name='offer_aspect_values_meta_data',
                on_delete=models.CASCADE)
    value_name = models.CharField(max_length=255,
                help_text=_('Offer Value Name'),
                verbose_name=_('Offer Value Name'))
    value_type = models.CharField(max_length=128,
                choices=VALUE_TYPE,
                help_text=_('Offer Value type'),
                verbose_name=_('Offer Value type'),
                null=True, blank=True)
    
    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.value_name

    class Meta:
        verbose_name = _("Offer Aspect Values Meta Data")
        verbose_name_plural = _("Offer Aspect Values Meta Data")
        ordering = ['-created_at']
class Quiz(ActivityTracking):
    name = models.CharField(max_length=56,
                            unique=True,
                            help_text=_('Quiz name'),
                            verbose_name=_('Quiz name'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Quiz")
        verbose_name_plural = _("Quizzes")
        ordering = ['-created_at']
class AnswerModelMap(ActivityTracking):
    answer = models.ForeignKey('quiz.Answer',
                               related_name='answer_model',
                               on_delete=models.CASCADE)
    model_catalog = models.ForeignKey('model_catalog.ModelCatalog',
                                      related_name='market_place_category',
                                      on_delete=models.CASCADE)

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return f"{self.answer.name} - {self.model_catalog.title}"

    class Meta:
        verbose_name = _("Answer Model Mapping")
        verbose_name_plural = _("Answer Model Mappings")
        ordering = ['-created_at']
Beispiel #8
0
class MyRogaMarketPlaceCategory(ActivityTracking):
    my_roga_category = models.ForeignKey('home.MyRogaCategory',
                                         related_name='my_roga_category',
                                         on_delete=models.CASCADE)
    market_place_category = models.ForeignKey(
        'home.MarketPlaceCategory',
        related_name='market_place_category',
        on_delete=models.CASCADE)

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return f"{self.my_roga_category.name} - {self.market_place_category.name}"

    class Meta:
        verbose_name = _("MyRoga and Market Place Category")
        verbose_name_plural = _("MyRoga and Market Place Categories")
        ordering = ['-created_at']
Beispiel #9
0
class AggregationModelSet(ActivityTracking):
    my_roga_category = models.ForeignKey(
        'home.MyRogaCategory',
        related_name='aggregation_my_roga_category',
        null=True,
        on_delete=models.SET_NULL)
    aspects = models.ManyToManyField(
        'product.AspectsMetaData',
        related_name='aggregation_technical_aspects')

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return f"{self.my_roga_category.name}"

    class Meta:
        verbose_name = _("Aggregation Model Set")
        verbose_name_plural = _("Aggregation Model Sets")
        ordering = ['-created_at']
Beispiel #10
0
class MyRogaCategory(ActivityTracking):
    name = models.CharField(max_length=56,
                            unique=True,
                            help_text=_('Category name'),
                            verbose_name=_('Category name'))
    description = models.TextField(blank=True,
                                   null=True,
                                   help_text=_('Category Description'),
                                   verbose_name=_('Category Description'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("MyRoga Category")
        verbose_name_plural = _("MyRoga Categories")
        ordering = ['-created_at']
Beispiel #11
0
class AspectValuesMetaData(ActivityTracking):
    VALUE_TYPE = (
        ('1', _('Text')),
        ('2', _('Number')),
    )

    aspect_meta_data = models.ForeignKey(
        'product.AspectsMetaData',
        related_name='aspect_values_meta_data',
        on_delete=models.CASCADE)
    my_roga_category = models.ForeignKey(
        'home.MyRogaCategory',
        related_name='aspect_values_my_roga_category',
        on_delete=models.CASCADE)
    value_name = models.CharField(max_length=255,
                                  help_text=_('Value Name'),
                                  verbose_name=_('Value Name'))
    normalized_aspect_value = models.CharField(
        max_length=255,
        help_text=_('Normalized Aspect Value'),
        verbose_name=_('Normalized Aspect Value'),
        null=True,
        blank=True)
    value_type = models.CharField(max_length=128,
                                  choices=VALUE_TYPE,
                                  help_text=_('Value type'),
                                  verbose_name=_('Value type'),
                                  null=True,
                                  blank=True)

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.value_name

    class Meta:
        verbose_name = _("Aspect Values Meta Data")
        verbose_name_plural = _("Aspect Values Meta Data")
        ordering = ['-created_at']
Beispiel #12
0
class MarketPlaceCategory(ActivityTracking):
    market_place = models.ForeignKey('home.MarketPlace',
                                     related_name='market_place',
                                     on_delete=models.CASCADE)
    name = models.CharField(max_length=255,
                            unique=True,
                            help_text=_('Category name'),
                            verbose_name=_('Category name'))
    description = models.TextField(blank=True,
                                   null=True,
                                   help_text=_('Category Description'),
                                   verbose_name=_('Category Description'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Market Place Category")
        verbose_name_plural = _("Market Place Categories")
        ordering = ['-created_at']
class Question(ActivityTracking):
    QUESTION_TYPE = (
        ('1', _('Usage/Place Question?')),
        ('2', _('Type Question?')),
        ('3', _('Budget Question?')),
    )

    quiz = models.ForeignKey('quiz.Quiz',
                             related_name='quiz',
                             on_delete=models.CASCADE)
    my_roga_category = models.ForeignKey(
        'home.MyRogaCategory',
        related_name='question_my_roga_category',
        on_delete=models.CASCADE)
    name = models.CharField(max_length=255,
                            help_text=_('Quiz name'),
                            verbose_name=_('Quiz name'))
    description = models.CharField(max_length=300,
                                   help_text=_('Quiz description'),
                                   verbose_name=_('Quiz description'))
    question_type = models.CharField(max_length=128,
                                     choices=QUESTION_TYPE,
                                     help_text=_('Question type'),
                                     verbose_name=_('Question type'),
                                     null=True,
                                     blank=True)
    order = models.IntegerField(help_text=_('Question order'),
                                verbose_name=_('Question order'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Question")
        verbose_name_plural = _("Questions")
        ordering = ['-created_at']
Beispiel #14
0
class ModelCatalog(ActivityTracking):
    MODEL_STATUS = (
        ('1', _('Live')),
        ('2', _('Deleted')),
    )

    product_catalog = models.ManyToManyField(
        'product.ProductCatalog', related_name='model_catalog_products')
    aggregation_model_set = models.ForeignKey(
        'product.AggregationModelSet',
        related_name='aggregation_model_catalog',
        on_delete=models.CASCADE)
    model_aggregation_key = models.TextField(
        help_text=_('Model Aggregation Key'),
        verbose_name=_('Model Aggregation Key'))
    my_roga_category = models.ForeignKey(
        'home.MyRogaCategory',
        related_name='model_catalog_my_roga_category',
        null=True,
        on_delete=models.SET_NULL)
    language = models.ForeignKey('home.Language',
                                 related_name='model_catalog_language',
                                 null=True,
                                 on_delete=models.SET_NULL)

    # Not in Use until Offer Table Created
    hero_offer = models.ForeignKey('offer.Offer',
                                   related_name='model_catalog_hero_offer',
                                   null=True,
                                   on_delete=models.SET_NULL)
    second_offer = models.ForeignKey('offer.Offer',
                                     related_name='model_catalog_second_offer',
                                     null=True,
                                     on_delete=models.SET_NULL)

    # For now we will use this Product Catalog id for Hero Product
    # After that we will use the Offer Table id
    hero_product = models.ForeignKey('product.ProductCatalog',
                                     related_name='model_catalog_hero_product',
                                     null=True,
                                     on_delete=models.SET_NULL)
    hero_product_price = models.FloatField(
        max_length=11,
        null=True,
        blank=True,
        default=0,
        help_text=_('Hero Product Price'),
        verbose_name=_('Hero Product Price'))
    hero_product_market_place = models.ForeignKey(
        'home.MarketPlace',
        related_name='hero_product_market_place',
        null=True,
        on_delete=models.SET_NULL)
    second_hero_product = models.ForeignKey(
        'product.ProductCatalog',
        related_name='model_catalog_second_hero_product',
        null=True,
        on_delete=models.SET_NULL)
    second_hero_product_price = models.FloatField(
        max_length=11,
        null=True,
        blank=True,
        default=0,
        help_text=_('Second Hero Product Price'),
        verbose_name=_('Second Hero Product Price'))
    second_hero_product_market_place = models.ForeignKey(
        'home.MarketPlace',
        related_name='second_hero_product_market_place',
        null=True,
        on_delete=models.SET_NULL)

    title = models.CharField(max_length=255,
                             help_text=_('Model title'),
                             verbose_name=_('Model title'))
    description = models.TextField(blank=True,
                                   null=True,
                                   help_text=_('Model Description'),
                                   verbose_name=_('Model Description'))
    description_image_url = models.TextField(
        blank=True,
        null=True,
        help_text=_('Model Description Image URL'),
        verbose_name=_('Model Description Image URL'))
    model_status = models.CharField(max_length=128,
                                    choices=MODEL_STATUS,
                                    help_text=_('Model Status'),
                                    verbose_name=_('Model Status'),
                                    null=True,
                                    blank=True)
    model_stealth = models.CharField(max_length=50,
                                     null=True,
                                     blank=True,
                                     help_text=_('Model Stealth'),
                                     verbose_name=_('Model Stealth'))
    product_review_count = models.IntegerField(
        null=True,
        blank=True,
        default=0,
        help_text=_('Product Review Count'),
        verbose_name=_('Product Review Count'))
    product_review_score = models.FloatField(
        max_length=11,
        null=True,
        blank=True,
        default=0,
        help_text=_('Product Review Score'),
        verbose_name=_('Product Review Score'))
    image_url = models.TextField(blank=True,
                                 null=True,
                                 help_text=_('Model Image URL'),
                                 verbose_name=_('Model Image URL'))
    review_url = models.TextField(blank=True,
                                  null=True,
                                  help_text=_('Review URL'),
                                  verbose_name=_('Review URL'))
    recommendation_score = models.FloatField(
        max_length=11,
        null=True,
        blank=True,
        default=0,
        help_text=_('Recommendation Score'),
        verbose_name=_('Recommendation Score'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = _("Model Catalog")
        verbose_name_plural = _("Model Catalog")
        ordering = ['-created_at']
Beispiel #15
0
class AspectsMetaData(ActivityTracking):
    ASPECT_TYPE = (
        ('1', _('Closed')),
        ('2', _('Open')),
    )

    ASPECT_INPUT_TYPE = (
        ('1', _('Single')),
        ('2', _('Multi')),
    )

    my_roga_category = models.ForeignKey(
        'home.MyRogaCategory',
        related_name='aspect_meta_data_my_roga_category',
        on_delete=models.CASCADE)
    name = models.CharField(max_length=255,
                            help_text=_('Aspect name'),
                            verbose_name=_('Aspect name'))
    aspect_type = models.CharField(max_length=128,
                                   choices=ASPECT_TYPE,
                                   help_text=_('Aspect meta data type'),
                                   verbose_name=_('Aspect meta data type'),
                                   null=True,
                                   blank=True)
    aspect_input_type = models.CharField(
        max_length=128,
        choices=ASPECT_INPUT_TYPE,
        help_text=_('Aspect meta data input type'),
        verbose_name=_('Aspect meta data input type'),
        null=True,
        blank=True)
    is_model_aspect = models.BooleanField(
        default=False,
        verbose_name=_('Is Model Aspect?'),
        help_text=_('Is Model Aspect?'),
    )
    model_title_order = models.IntegerField(
        default=None,
        null=True,
        blank=True,
        help_text=_('Model Title Order'),
        verbose_name=_('Model Title Order'))
    model_title_text_before_aspect = models.CharField(
        max_length=255,
        null=True,
        blank=True,
        help_text=_('Model Title Text Before Aspect'),
        verbose_name=_('Model Title Text Before Aspect'))
    model_title_text_after_aspect = models.CharField(
        max_length=255,
        null=True,
        blank=True,
        help_text=_('Model Title Text After Aspect'),
        verbose_name=_('Model Title Text After Aspect'))

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _("Aspects Meta Data")
        verbose_name_plural = _("Aspects Meta Data")
        ordering = ['-created_at']
Beispiel #16
0
class ProductCatalog(ActivityTracking):
    PRODUCT_STATUS = (
        ('1', _('Live')),
        ('2', _('Deleted')),
    )

    my_roga_category = models.ForeignKey(
        'home.MyRogaCategory',
        related_name='product_my_roga_category',
        null=True,
        on_delete=models.SET_NULL)
    language = models.ForeignKey('home.Language',
                                 related_name='product_language',
                                 null=True,
                                 on_delete=models.SET_NULL)

    # For Now this two columns hero_offer and second_offer not in use
    hero_offer = models.ForeignKey('offer.Offer',
                                   related_name='product_hero_offer',
                                   null=True,
                                   on_delete=models.SET_NULL)
    second_offer = models.ForeignKey('offer.Offer',
                                     related_name='product_second_offer',
                                     null=True,
                                     on_delete=models.SET_NULL)
    title = models.CharField(max_length=255,
                             help_text=_('Product title'),
                             verbose_name=_('Product title'),
                             blank=True,
                             null=True)
    description = models.TextField(blank=True,
                                   null=True,
                                   help_text=_('Product Description'),
                                   verbose_name=_('Product Description'))
    product_status = models.CharField(max_length=128,
                                      choices=PRODUCT_STATUS,
                                      help_text=_('Product Status'),
                                      verbose_name=_('Product Status'),
                                      null=True,
                                      blank=True)
    product_stealth = models.CharField(max_length=50,
                                       null=True,
                                       blank=True,
                                       help_text=_('Product Stealth'),
                                       verbose_name=_('Product Stealth'))
    technical_aspects = models.ManyToManyField(
        'product.AspectsMetaData', related_name='product_technical_aspects')
    technical_aspect_values = models.ManyToManyField(
        'product.AspectValuesMetaData',
        related_name='product_technical_aspect_values')

    # New Columns
    image_url = models.TextField(blank=True,
                                 null=True,
                                 help_text=_('Product Image URL'),
                                 verbose_name=_('Product Image URL'))
    review_url = models.TextField(blank=True,
                                  null=True,
                                  help_text=_('Review URL'),
                                  verbose_name=_('Review URL'))
    review_count = models.IntegerField(null=True,
                                       blank=True,
                                       default=0,
                                       help_text=_('Review Count'),
                                       verbose_name=_('Review Count'))
    review_score = models.FloatField(max_length=11,
                                     null=True,
                                     blank=True,
                                     default=0,
                                     help_text=_('Review Score'),
                                     verbose_name=_('Review Score'))
    hero_offer_url = models.TextField(blank=True,
                                      null=True,
                                      help_text=_('Hero Offer URL'),
                                      verbose_name=_('Hero Offer URL'))
    hero_offer_price = models.FloatField(max_length=11,
                                         null=True,
                                         blank=True,
                                         default=0,
                                         help_text=_('Hero Offer Price'),
                                         verbose_name=_('Hero Offer Price'))
    hero_offer_market_place = models.ForeignKey(
        'home.MarketPlace',
        related_name='hero_offer_market_place',
        null=True,
        on_delete=models.SET_NULL)
    second_hero_offer_url = models.TextField(
        blank=True,
        null=True,
        help_text=_('Second Hero Offer URL'),
        verbose_name=_('Second Hero Offer URL'))
    second_hero_offer_price = models.FloatField(
        max_length=11,
        null=True,
        blank=True,
        default=0,
        help_text=_('Second Hero Offer Price'),
        verbose_name=_('Second Hero Offer Price'))
    second_hero_offer_market_place = models.ForeignKey(
        'home.MarketPlace',
        related_name='second_hero_offer_market_place',
        null=True,
        on_delete=models.SET_NULL)

    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = _("Product Catalog")
        verbose_name_plural = _("Product Catalog")
        ordering = ['-created_at']
class Offer(ActivityTracking):
    QUALIFICATION_STATUS = (
        ('1', _('Qualified')),
        ('2', _('Rejected')),
        ('2', _('Pending')),
    )

    title = models.CharField(max_length=255,
                help_text=_('Offer title'), 
                verbose_name=_('Offer title'))
    seller_offer_id = models.CharField(max_length=255,
                help_text=_('Seller Offer Id'), 
                verbose_name=_('Seller Offer Id'))
    asin = models.CharField(max_length=255,
                help_text=_('ASIN'), 
                verbose_name=_('ASIN'))
    market_place = models.ForeignKey('home.MarketPlace',
                related_name='offer_market_place',
                on_delete=models.CASCADE)
    offer_url = models.TextField(blank=True, null=True,
                help_text=_('Offer URL'),
                verbose_name=_('Offer URL'))
    offer_price = models.FloatField(max_length=11,
                null=True, blank=True, default=0,
                help_text=_('Offer Price'),
                verbose_name=_('Offer Price'))
    offer_quantity = models.IntegerField(null=True, blank=True, default=0,
                help_text=_('Offer Quantity'), 
                verbose_name=_('Offer Quantity'))
    offer_reviews_count = models.IntegerField(null=True, blank=True, default=0,
                help_text=_('Offer Reviews Count'), 
                verbose_name=_('Offer Reviews Count'))
    offer_reviews_score = models.FloatField(max_length=11,
                null=True, blank=True, default=0,
                help_text=_('Offer Reviews Score'),
                verbose_name=_('Offer Reviews Score'))
    offer_image_url = models.TextField(blank=True, null=True,
                help_text=_('Offer Image URL'),
                verbose_name=_('Offer Image URL'))
    offer_language = models.ForeignKey('home.Language',
                related_name='offer_language',
                null=True,
                on_delete=models.SET_NULL)
    brand_name = models.CharField(max_length=56,
                help_text=_('Offer Brand Name'), 
                verbose_name=_('Offer Brand Name'))
    mpn = models.CharField(max_length=56,
                help_text=_('Manufacturur Part Number'), 
                verbose_name=_('Manufacturur Part Number'))
    offer_description = models.TextField(blank=True, null=True,
                help_text=_('Offer Description'),
                verbose_name=_('Offer Description'))
    technical_aspects = models.ManyToManyField('offer.OfferAspectsMetaData',
                related_name='offer_technical_aspects')
    technical_aspect_values = models.ManyToManyField('offer.OfferAspectValuesMetaData',
                related_name='offer_technical_aspect_values')
    qualification_status = models.CharField(max_length=128,
                choices=QUALIFICATION_STATUS,
                help_text=_('Qualification Status'),
                verbose_name=_('Qualification Status'),
                null=True, blank=True)
    
    objects = ActivityQuerySet.as_manager()

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = _("Offer")
        verbose_name_plural = _("Offers")
        ordering = ['-created_at']