How to insert recent session Username or UserId in database table in Django?

2015-08-18 Thread Remaze Vs
I am new in Django, I am trying to make ecommerce project. I want to Insert recent login username or user Id in database by using formview code.so how to insert recent login username in database? Here is Model.py class Product(models.Model): title = models.CharField(max_

Re: How to insert recent session Username or UserId in database table in Django?

2015-08-19 Thread Remaze Vs
thanks for your time, but I am facing error invalid syntax , on that line import django.contrib.auth.models import User my model.py from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import post_save import d

Re: How to insert recent session Username or UserId in database table in Django?

2015-08-19 Thread Remaze Vs
> > OperationalError at / >> >> no such column: products_product.User_id >> >> operationalError at/ no such column:products_product.User_id -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Re: How to insert recent session Username or UserId in database table in Django?

2015-08-19 Thread Remaze Vs
operationalError at/ no such column:products_product.User_id -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post

'self' is not define

2015-08-19 Thread Remaze Vs
I am new in Django I am trying to insert session login username in database.but facing this error. my model.py file class Product(models.Model): title = models.CharField(max_length=120) description = models.TextField(null=True, blank=True) category = models.ManyToManyField(Category, null=True,

Issue Django, in insert session login user data in database?

2015-08-21 Thread Remaze Vs
Actually I want to insert session login user data in database but I when I put this code I get all register user in Dropdown but I want to only current login user data not all and also I want to hide this field value.please help. model.py from django.conf import settingsfrom django.core.urlres

I have error like Type Error save() takes at least 2 arguments (1 given) in Django project.

2015-08-31 Thread Remaze Vs
view.py file class DealsForm(ModelForm): class Meta: model = Product fields = ['title','description','category','price','sale_price','slug','active','update_defaults','user'] exclude = ('user',) model.py file class Product(models.Model): title = models.CharF

How to insert session User id in database .?

2015-08-31 Thread Remaze Vs
I am trying to insert session login user id in database... here is my code view.py from django.shortcuts import render,redirect, Http404 from django.forms import ModelForm # Create your views here. from marketing.forms import EmailForm from marketing.models import MarketingMessage, Slider from