One-to-many relations

2007-07-05 Thread mrstone
Hi all I have a problem I have been struggeling with for a while. I have two models: InfoProxy and Permission A InfoProxy can have several Permissions class Permission(models.Model): info_proxy = models.ForeignKey(InfoProxy, related_name='permissions') permission_type =

Re: Simple python question

2007-04-11 Thread mrstone
> What I'm doing is to load a model from a template. > I have in a template something like this: > {% block menu %} > {% block rss %} > > I want to load "menu" and "rss", but I think that is too much work for > now, I have no idea how to implement it and I probably won't do it. > Thank you very

Problems with GenericForeignKey and ForeignKey

2007-03-18 Thread mrstone
I have sticky bug I can not figure out how to solve. On the dev server it works fine, but moving to mod_python... I'm running a query and it throws an exception, but if I reload the page it works fine. the model has this structure: class InfoProxy(models.Model): info_type =

Re: Multiple profiles

2007-02-06 Thread mrstone
The current framework only allow for one "profile class" per site. If you want you can let this class return different profiles depending on the user. class mysiteprofile(models.Model) user = models.ForeignKey(User, unique=True, related_name='user_profile') ... ... def

Cookies on mobile phones NOT to expire at browser close

2007-01-23 Thread mrstone
I have been trying to use persistent sessions (cookies) on a mobile phone and never got it to work. When I change settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = False cookies stops to work on the phone. After digging down I noticed that it's setting max_age that brakes it on the phone. When setting

Newforms and MySQL

2007-01-15 Thread mrstone
Im having trouble to get 'funky' characters to work with newform posts. I have read the posts on the subject, and Im not sure if I run into a bug... class Guide(models.Model): about = models.CharField(maxlength=1500) class EditForm(forms.Form): about =

Re: Weird apache problem

2007-01-06 Thread mrstone
A wild guess is that there is something wrong with the data in your database... ...are you using the same database from the dev server? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Cookies on mobile phones

2006-12-30 Thread mrstone
I have a problem using cookies lasting longer than a session. When setting SESSION_EXPIRE_AT_BROWSER_CLOSE to True everything works fine but setting to False NO cookie is set. Hints in any direction is welcome:-) Cheers Sten --~--~-~--~~~---~--~~ You

Re: (Admin) user logged in in model field

2006-11-06 Thread mrstone
Hi I think you will find your answers here: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser regards Sten --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: UTF8 character set problem

2006-10-27 Thread mrstone
How did you exported the data between linux and xp? Have you checked that the db table in mysql is set to utf8? cheers :-S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Relation query stops working when moving to Linux (from Mac)

2006-10-13 Thread mrstone
I'm getting a strange error that I have not been able to sort out. When moving my project to the production server the below query stops working. (It works fine on Mac) I noticed that using CamelCase in fieldnames is an issue when moving code, but that doesn't seem to be the problem here. Any

Re: Relevance

2006-10-04 Thread mrstone
Hi Beau No, I'm afraid not. I did not have time to look into it further so it's still an open thing for me. Regards Sten --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Relevance

2006-09-15 Thread mrstone
Hi I'm fiddling around with MySQL fulltext search and run into a problem. Using the below code works: match_expr = "MATCH(name) AGAINST (%s IN BOOLEAN MODE)" qs = Place.objects.all().filter(name__search=query).extra(select={'relevance': match_expr}, params=[query]) But when calling

Session get_decoded

2006-09-06 Thread mrstone
File "/usr/local/lib/python2.4/site-packages/django/contrib/sessions/middleware.py", line 57, in _get_session self._session_cache = s.get_decoded() File "/usr/local/lib/python2.4/site-packages/django/contrib/sessions/models.py", line 61, in get_decoded encoded_data =

Re: Disable autoreload to allow single thread debugging

2006-08-15 Thread mrstone
If you running Eclipse with PyDev you can create a file 'debugServer.py' with the following content: import os os.environ['DJANGO_SETTINGS_MODULE']='mysite.settings' from django.core import management management.runserver(addr='0.0.0.0', port='8080', use_reloader=False) Then set up Eclipse to