django url and reverse

2009-11-29 Thread caliman
Hi! In my project most of my views requires the user to be logged in but in some i don't for example the login view wich only displays a login form. When I'm going to the login form as a non logged in user I get an error: "Error was: 'AnonymousUser' object has no attribute 'get_profile'" The error

model upload_to

2009-08-04 Thread caliman
Hi! I'm trying to change upload_to dynamically. My model: class File(models.Model): type = models.CharField(max_length=10) the_file = models.FileField(upload_to="folder") def __unicode__(self): return self.file.name Tried following: 1, overwrite upload_to in save: def save(self

OR in query_set

2009-07-21 Thread caliman
How do you use django to use OR instead av AND when you use filter? Let's say I want: SELECT * FROM table WHERE attrib1 IN (1,2,3) OR attrib2 IN (4,5,6) in django: table.objects.filter(attrib1__in=[1,2,3]).filter(attrib2__in=[4,5,6]) this will be like: SELECT * FROM table WHERE attrib1 IN (1,2

Re: Populating list_display with data from two models?

2009-03-29 Thread caliman
On 27 Feb, 01:56, Jamie Richard Wilson wrote: > I've extended the User model with a UserPofile model and have inline > editing working. Setup is something like this: > > class UserProfile(models.Model): >     user = models.ForeignKey( >        User, >        unique=True, >        ) >        posit

Re: Django-Logging Problem..

2009-03-26 Thread caliman
do you have INTERNAL_IPS set in yout settings file? if your on localhost you probably need: INTERNAL_IPS = ('127.0.0.1',) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,