When any user login my Django web application, I want to user_id,
user_group, user_type in session. Because I wanna avoid querying
request.user on every request for web page faster. So, I saved this and I
would like to pass this parameter User.objects.get(pk=request.session.get(
'user_id'))
But
class User(PermissionsMixin, AbstractBaseUser):
name = models.CharField(max_length=511, null=True, blank=True)
email = models.EmailField(unique=True)
phone_number = PossiblePhoneNumberField(blank=True, null=True, default=None)
addresses = models.ManyToManyField(Address, blank=True)
is_staff = mode
I am creating a django application. now I would like to create logo, site
name & info which will be dynamic. I want to create Model for this , but
problem is use create many logo, site name or info. but Use can create or
edit only one logo, one site name. How can I do this?
--
You received thi
this is query:
```
sub_query =
PaymentDetails.objects.filter(order=OuterRef('pk')).order_by('-updated_at')[:1]
payment_summary = """select jsonb_build_object(
'total_paid_amount', coalesce(sum(amount), 0),
'total_due_amount', CASE WHEN (order_order.total_gross - coalesce(sum(amount),
0)) > 0.02 t
I've an existing project on Django 3.1 and I upgraded my project to Django
3.2. I created an app called payment on my project. But When I make
migrations. It trow an error
```AttributeError: 'TextField' object has no attribute 'db_collation'```
```
from django.db import models
from django.conf i
I've two model. I would like to save data from ForeignKey model. I'm
created a modelform and save with my main foreignkey model. But I got this
error ValueError at /c/customer/1/ Cannot assign "'1'":
"BillingData.customer" must be a "CustomerData" instance.
I created Django model form and ho
6 matches
Mail list logo