Re: manipulator.save() and manytomany relationship

2006-03-29 Thread limodou
On 3/30/06, yml <[EMAIL PROTECTED]> wrote: > > I don't set any value for the profile_id. This attribute where added by > django, I guess in order to have a "primary key". > If I comment the line with set_localisation (which is my many to many > relation) I do not get this error so I do not see why

Re: manipulator.save() and manytomany relationship

2006-03-29 Thread yml
I don't set any value for the profile_id. This attribute where added by django, I guess in order to have a "primary key". If I comment the line with set_localisation (which is my many to many relation) I do not get this error so I do not see why I should care about this with this additional attrib

moving items in admin-interface

2006-03-29 Thread patrickk
i´m just trying to implement buttons for moving up/down elements in the admin-interface (which should be replaced with ajax-drag later on). therefore, my model has a field "position" (positivesmallinteger). has anyone already written a function for changing the position-field? or does anyone know

Re: Custom templatetags are ignored. Why ?

2006-03-29 Thread Max Battcher
ak wrote: > After a bit of research I found that my templatetags dir has > __init__.pyc file and it tells me that django tried to include this > directory but my news_tags.py file has no .pyc Sounds like you have a syntax error in news_tags.py. Try importing it within a Python shell. Basically

Re: Custom templatetags are ignored. Why ?

2006-03-29 Thread ak
Sorry guys it was my stupidity :) I should have written {% load news_tags %} instead of {% load "news_tags" %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Custom templatetags are ignored. Why ?

2006-03-29 Thread ak
Hi everyone I wrote a small templatetags library (just one tag), put it into existing app directory (into subdirectory templatetags), added __init__.py there but after I added to my templates: {% load "news_tags" %} {% latest_news %} django shows me an error: '"news_tags"' is not a valid tag libr

Re: manipulator.save() and manytomany relationship

2006-03-29 Thread limodou
On 3/30/06, yml <[EMAIL PROTECTED]> wrote: > > hello limodou, > > you have been of great help till now, thank you for your time. > > I tried list because I was not working without: > > temp.set_localisation(list(new_data['localisation'])) > = > error page w

Re: manipulator.save() and manytomany relationship

2006-03-29 Thread yml
hello limodou, you have been of great help till now, thank you for your time. I tried list because I was not working without: temp.set_localisation(list(new_data['localisation'])) = error page with: list(new_data['localisation'])

Re: follow relationship

2006-03-29 Thread Todd O'Bryan
Wait. How do I define the user-friendly stuff that will show up in the select box for the admin interface?ToddOn Mar 29, 2006, at 9:59 PM, Ned Batchelder wrote: What I've done in these cases is to define a Constants class:     class Constants:     """ Construct one of these with keyword argume

Re: follow relationship

2006-03-29 Thread Todd O'Bryan
Wow. That's very elegant. I'm loving the Python.ToddOn Mar 29, 2006, at 9:59 PM, Ned Batchelder wrote: What I've done in these cases is to define a Constants class:     class Constants:     """ Construct one of these with keyword arguments, and you can use the     attributes.     "

Re: follow relationship

2006-03-29 Thread Ned Batchelder
What I've done in these cases is to define a Constants class:     class Constants:     """ Construct one of these with keyword arguments, and you can use the     attributes.     """         def __init__(self, **kwargs):     for k, v in kwargs.items():     set

[no subject]

2006-03-29 Thread Brian Elliott
Hey folks, Is there a recommended way to do logging in a production environment? Should I just use Python's logging module or is there a built-in way to do this? (I am using the M-R branch.) Thanks, Brian PS: I'm a new user, so forgive me if I'm asking the obvious... --~--~-~--

Re: manipulator.save() and manytomany relationship

2006-03-29 Thread limodou
On 3/30/06, yml <[EMAIL PROTECTED]> wrote: > > Hello djangonauts, > > I wrote my first manipulator and there is still some part that I am not > understanding. > I have the feeling that I am missing something obvious in the save > function of my manipulator but I am unable to improve it. > > I woul

Re: limit_choices_to

2006-03-29 Thread Luke Plant
On Monday 27 March 2006 16:50, [EMAIL PROTECTED] wrote: > I've just used the first bit of Luke's wheeze- storing the user.id > and stuffing it in the model's save method. > I had to put 'null-True' in the model to get the user.id bit of this > to work. Otherwise the 'if self.officer_id is None:'

Re: limit_choices_to

2006-03-29 Thread Luke Plant
On Sunday 26 March 2006 21:01, tonemcd wrote: > I think that this http://lukeplant.me.uk/blog.php?id=1107301634 might > be helpful. There's also been some traffic on limit_choices_to in the > group recently (although not strictly relevent to your problem I > think) Note that this blog entry assu

Re: Overthinking urls.py?

2006-03-29 Thread Todd O'Bryan
Is it possible to do it all in urls.py? I don't know much about Python, yet, but could you have two way look-up. urls.py has the URL- >View handled. Could you stick in a dictionary based on classes (and PKs, maybe) that would return the appropriate URL? Todd On Mar 29, 2006, at 10:38 AM, A

Re: OneToOneField

2006-03-29 Thread Joseph Kocherhans
On 3/29/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote: > > If someone would file a ticket for this (if they haven't already) that > would be great. I'll look at it in a few days if no one else has. I'm > trying to wrap up some other project this week. Oops. Nevermind about filing a ticket. I mi

Re: How to get vote total in poll tutorial

2006-03-29 Thread JHeasly
> > Then you probably want it to read: > choices.get_values(fields=['poll', 'votes'], poll_id__exact=1) > > i.e. your "field" is "poll_id" and the lookuptype is "exact" > which translates to "poll_id__exact", and THEN the equals sign > and what value you are asking it to match. > > -- > Glenn

Re: Searching in a foreign table field

2006-03-29 Thread Jaime G. Wong
Thanks Tabo, that's it. On Wed, Mar 29, 2006 at 09:00:39PM -, Gustavo Picon wrote: > > You have to specify in what field of the FK object you want the search > to work. For instance if there is a "name" field in the Song model, you > may want to try: > > search_fields = ('song__name',

manipulator.save() and manytomany relationship

2006-03-29 Thread yml
Hello djangonauts, I wrote my first manipulator and there is still some part that I am not understanding. I have the feeling that I am missing something obvious in the save function of my manipulator but I am unable to improve it. I would be glad if someone could explain me how to set_localisati

Re: Searching in a foreign table field

2006-03-29 Thread Gustavo Picon
You have to specify in what field of the FK object you want the search to work. For instance if there is a "name" field in the Song model, you may want to try: search_fields = ('song__name', ), Hope that helps. --~--~-~--~~~---~--~~ You received this message

Re: OneToOneField

2006-03-29 Thread Joseph Kocherhans
On 3/29/06, layik <[EMAIL PROTECTED]> wrote: > > Hello there, > > sorry to bother you. > > I was wondering if you have solved your OneToOne problem. if so could > let me know how I could solve it as well?? > thanks > > > ChaosKCW wrote: > > Agreeded, I am trying to use OneToOne in MR branch and ge

Re: Overthinking urls.py?

2006-03-29 Thread Adrian Holovaty
On 3/29/06, James Bennett <[EMAIL PROTECTED]> wrote: > On 3/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > And now you're encoding URLs (which are, in my mind, definitely > > presentation-related) in the models? > > It's not something new; it's been this way since the first public > relea

Re: apache threading - 'QueryDict' object has no attribute '_mutable'

2006-03-29 Thread Ivan Sagalaev
Eugene Lazutkin wrote: >Woot! 1539 and 1442 are both committed! Now all multithreaded guys, and >MySQL users can start up projects right out of the box without digging >for "magic incantations" in tickets, mail lists, and blogs! > > Woots and thanks to Adrian and Eugene from me too :-) I hop

Re: follow relationship

2006-03-29 Thread Ivan Sagalaev
Todd O'Bryan wrote: >Your comment at the end got me thinking, though. Writing > >trunk.get_branch(kind__exact=2) > >is not very illuminating, but you're correct that the value 'Dead' >could get changed later. In Java, I'd use constants for the integer >values > >public static final int DEAD =

Re: Overthinking urls.py?

2006-03-29 Thread Kevin
I think the problem is that urlconf provides a url => view mapping. Really though, for creating the links, we need the reverse mapping. We usually know the view we want to display, but don't know it's URL. For example, you have a bulletin board app: urls.py: urlpatterns = patterns('' '^comm

Re: Mysterious thread problem

2006-03-29 Thread Timo Mäkelä
Thanks a lot, didn't thought about that in the first place :) yuri kirjoitti: > Yip, we had the same problem, it's to do with the time change that > happened 2 days ago. To cut a long story short, set the timezone in > your settings file to TIME_ZONE = "" > Django will then use the timezone retur

Re: Mysterious thread problem

2006-03-29 Thread yuri
Yip, we had the same problem, it's to do with the time change that happened 2 days ago. To cut a long story short, set the timezone in your settings file to TIME_ZONE = "" Django will then use the timezone returned by windows. The problem is that in django.conf.settings.py, line 64, it sets the T

Re: Get objects in _manipulator_validate_.....() methods

2006-03-29 Thread Matthew Flanagan
On 3/29/06, Rudolph <[EMAIL PROTECTED]> wrote: > > I'm writing a _manipulator_validate_.() method. These methods > become methods for the manipulator of a model and will be validated > before save() is called. Any exception of validators.ValidationError > will very nicely be displayed in the

Re: admin apache solved? / now mysql problem

2006-03-29 Thread abe
Andy Dustman wrote: > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > Andy Dustman wrote: > > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > Andy Dustman wrote: > > > > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > OperationalError: (2002, "Can't connect to local MySQL s

Re: ANN:Woodlog Testing

2006-03-29 Thread limodou
On 3/29/06, yml <[EMAIL PROTECTED]> wrote: > > hello limodou, > > I was think to start developing something similar to add it to a portal > I am working on. > Of course I would have done it with a less talent than you. :-) > > Are you going to open source it that I could learn from your source a

Re: What is Caching my DB

2006-03-29 Thread Michael Twomey
On 3/28/06, Siah <[EMAIL PROTECTED]> wrote: > > Thank you Michael, > > I must add that on my laptop using django's runserver command, this > problem does not exist. > > I am still stock, so all help is greatly appreciated, Ok, so much for that theory :) Another possibility might be some kind of c

Re: ANN:Woodlog Testing

2006-03-29 Thread yml
hello limodou, I was think to start developing something similar to add it to a portal I am working on. Of course I would have done it with a less talent than you. :-) Are you going to open source it that I could learn from your source and use it Good job --~--~-~--~~---

Re: admin apache solved? / now mysql problem

2006-03-29 Thread abe
Todd O'Bryan wrote: > On Mar 28, 2006, at 8:20 AM, Andy Dustman wrote: > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > >> OperationalError: (2002, "Can't connect to local MySQL server through > >> socket '/var/lib/mysql/mysql.sock' (13)") > > > > This indicates your MySQL server isn't runnin

Re: Assigning default value for field in admin

2006-03-29 Thread Daniel Bimschas
Hey that looks great! Thanks a lot, it will do for my purposes! 2006/3/27, tonemcd <[EMAIL PROTECTED]>: > > This looks like it might help, > http://lukeplant.me.uk/blog.php?id=1107301634 although it's not exactly > what you're after... > > Cheers, > Tone > > > > --~--~-~--~~

Re: Overthinking urls.py?

2006-03-29 Thread James Bennett
On 3/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > And now you're encoding URLs (which are, in my mind, definitely > presentation-related) in the models? It's not something new; it's been this way since the first public release of Django. Adrian and others have said elsewhere that it's no

Re: Flatpages and comments - question

2006-03-29 Thread ak
Ok found the answer myself. I added at the bottom of content block: {% if flatpage.enable_comments %} {% load comments %} {% free_comment_form for flatpages.flatpages flatpage.id %} etc ... --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Overthinking urls.py?

2006-03-29 Thread limodou
On 3/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Adrian Holovaty wrote: > > The convention is to put the URL-creation logic in your models, in a > > get_absolute_url() method. Here's a quick example: > > > > class Person(meta.Model): > > gender = meta.CharField(maxlength=1)

Flatpages and comments - question

2006-03-29 Thread ak
Hello guys ! Could anyone please tell me why I don't see comments bellow the page when I click on "enable comments" in admin for a flat page ? Should it be enabled by adding: {% load comments %} {% free_comment_form for . %} to the flatpages/default template ? --~--~-~--~~--

Re: checklist

2006-03-29 Thread limodou
On 3/29/06, Jiri Barton <[EMAIL PROTECTED]> wrote: > > Hello there, > > I want to display a checklist dynamically: > > 1 apple [ ] > 3 pears [ ] > 8 plums [ ] > > ([ ] stands for checkboxes) > > The items are generated on the fly. I can create the form fields in a > manipulator __init__ dynamicall

Re: Overthinking urls.py?

2006-03-29 Thread [EMAIL PROTECTED]
Adrian Holovaty wrote: > The convention is to put the URL-creation logic in your models, in a > get_absolute_url() method. Here's a quick example: > > class Person(meta.Model): > gender = meta.CharField(maxlength=1) # 'm' or 'f' > full_name = meta.CharField(maxlength=50) > >

admin templates & css

2006-03-29 Thread layik
Hi all, thanks for your help in advance two problems 1. I have a class with about 15 attributes, in the admin templates, when lets say creating a Poll with a Choice which has 15 choices, what is the best way of viewing them choices? what I mean is currently you have to scroll right to get to al

Re: OneToOneField

2006-03-29 Thread layik
Hello there, sorry to bother you. I was wondering if you have solved your OneToOne problem. if so could let me know how I could solve it as well?? thanks ChaosKCW wrote: > Agreeded, I am trying to use OneToOne in MR branch and get the same > problems. > > I have: > > class Employee(models.Mode

Re: OneToOneField

2006-03-29 Thread layik
might be a too late reply but could any of you tell me what MR Branch or svn Trunk that you are tlkaing about is? I am sorry I dont know any of them. I still have the problem unsolved. thanks --~--~-~--~~~---~--~~ You received this message because you are subsc

checklist

2006-03-29 Thread Jiri Barton
Hello there, I want to display a checklist dynamically: 1 apple [ ] 3 pears [ ] 8 plums [ ] ([ ] stands for checkboxes) The items are generated on the fly. I can create the form fields in a manipulator __init__ dynamically, such as in: for item in items: self.fields.append(CheckboxField(f