In poll app, I set Time_Zone='Asia/Kolkata' and USE_TZ=True in settings.py
file.
In models.py file,
import datetime
from django.utils import timezone
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date p
Hey everyone, I created a custom User model and admin.py. I'm having as
issue in the admin console where if I click save on a user, even without
modifying any fields, the user history always adds a 'Changed password.'
record. It looks like this used to be a problem (
https://github.com/django/dj
You want there to be only one BackgroundImage record marked as 'using_image'
for a given user. I'm saying you should add a field to your User table that
tracks their BackgroundImage.
On Nov 3, 2013, at 2:43 PM, Aamu Padi wrote:
> Thank you for the reply Lee. But could please elaborate a little
Thank you for the reply Lee. But could please elaborate a little more. :)
On Mon, Nov 4, 2013 at 2:48 AM, Lee Hinde wrote:
>
> On Nov 3, 2013, at 12:23 PM, Aamu Padi wrote:
>
> > How to make a model with a yes/no field, if yes that particular object
> (image) will be used as the background, an
On Nov 3, 2013, at 12:23 PM, Aamu Padi wrote:
> How to make a model with a yes/no field, if yes that particular object
> (image) will be used as the background, and no other image will be selected.
>
> I have come with this model:
>
> class BackgroundImage(models.Model):
> user =
How to make a model with a yes/no field, if yes that particular object
(image) will be used as the background, and no other image will be
selected.
I have come with this model:
class BackgroundImage(models.Model):
user = models.ForeignKey(user)
caption = models.CharField(max_l
How to make a model with a yes/no field, if yes that particular object
(image) will be used as the background, and no other image will be
selected.
I have come with this model:
class BackgroundImage(models.Model):
user = models.ForeignKey(user)
caption = models.CharField(max_l
On Sunday, 3 November 2013 18:09:49 UTC, Leon Sasson wrote:
> Django serializer works really well when you need to serialize a QuerySet,
> but often times I need to serialize a JSON object with more than just a
> QuerySet.
> This leads me to serialize the QuerySet, and then load it again to a
>
On Fri, 1 Nov 2013 10:11:05 -0700 Jon Dufresne
wrote:
> I am trying to log warnings inside settings.py. I want to log warnings
> when settings (from an outside source) are not provided, but the
> application can continue. Is this possible? It seems like this might
> not work as logging requires se
On Sun, 3 Nov 2013 18:31:42 +0530 Robin Lery
wrote:
> Suppose this is a model for an app Blog:
> class Blog(models.Model):
> And this is another model for an app Status:
> class Status(models.Model):
> How do I come up with something like this:
> What I wan't is that, in the home page, I would
solved! Here the code:
class NameURLForm(forms.ModelForm):
class Meta:
model = NameURL
def __init__(self, *args, **kwargs):
super(NameURLForm, self).__init__(*args, **kwargs)
listURL = []
for name, L in get_resolver(None).reverse_dict.items():
i
Django serializer works really well when you need to serialize a QuerySet,
but often times I need to serialize a JSON object with more than just a
QuerySet.
This leads me to serialize the QuerySet, and then load it again to a python
dict and then serialize it again. Like this:
peopleJSON = seri
I haven't looked into what would be required to allow unicode in usernames.
If someone would like to dive in and write some documentation on how to do
so that seems likely to be accepted as this has come up a couple times.
On Thursday, October 31, 2013 2:46:43 AM UTC-4, Alex Strickland wrote:
>
Hi,
In poll app website, Select poll to change page my drop-down list is
empty.While in Mysql command prompt when I do select * command it shows the
tuples.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and
>
> write custom method on User model or custom template tag
first one allow you to do something like:
{% for item in user.get_what_you_need %}
...
{% endfor %}
and second one:
{% get_what_you_need user %}
--
You received this message because you are subscribed to the Google Groups
"Django
what about deriving the Blog class from the Status class?
| class Status(models.Model):
content = BleachField()
pub_date = models.DateTimeField(default=datetime.now)
creator = models.ForeignKey(User)|
|class Blog(Status):
title= models.CharField(max_length=200)
Suppose this is a model for an app Blog:
class Blog(models.Model):
title = models.CharField(max_length=200)
pub_date = models.DateTimeField(default=datetime.now)
creator = models.ForeignKey(User)
content = BleachField()
And this is another model for an app Status:
class Status(mo
Hi
You are running into typical production Django problems - works fine in
testing, terrible in production.
Firstly
If you use attributed many-to-manys, create the table outside of Django and use
raw SQL.Create a primary key on the two things being related (usually larger
table first).
Multi-colu
You should rewrite the query into a form that doesn't require distinct. In
general, when you see a query that has joins and DISTINCT, that should be
an alarm bell that something isn't written correctly in the query.
Unfortunately Django's ORM generates such queries, and that isn't easy to
fix a
19 matches
Mail list logo