Re: Unicode and django/db/backends/util.py

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 22:26 -0700, Beau Hartshorne wrote: > On 3-Oct-06, at 7:36 PM, Malcolm Tredinnick wrote: > > > So this is the value that the string has right at the moment the > > exception occurs? Can you paste the traceback you see, please (and > > preferably the value of 'sql' and

Re: Unicode and django/db/backends/util.py

2006-10-03 Thread Beau Hartshorne
On 3-Oct-06, at 7:36 PM, Malcolm Tredinnick wrote: > So this is the value that the string has right at the moment the > exception occurs? Can you paste the traceback you see, please (and > preferably the value of 'sql' and 'params' at that point as well). > > I'm a bit in the dark about what is

Re: User object available in base template

2006-10-03 Thread Alan Green
On 10/4/06, Patrick J. Anderson <[EMAIL PROTECTED]> wrote: ... > def main(request): > posts = Post.objects.filter(is_approved = > True).order_by('-time_added')[:5] > t = loader.get_template('homepage.html') > c = RequestContext({ > 'latest_posts': posts, > }) That's

Re: User object available in base template

2006-10-03 Thread Don Arbow
On Oct 3, 2006, at 9:30 PM, Patrick J. Anderson wrote: > > def main(request): > posts = Post.objects.filter(is_approved = > True).order_by('-time_added')[:5] > t = loader.get_template('homepage.html') > c = RequestContext({ > 'latest_posts': posts, > }) > return

Re: User object available in base template

2006-10-03 Thread Patrick J. Anderson
Forgot to add my specific error: Exception Type: AttributeError Exception Value:'dict' object has no attribute 'user' Exception Location: /usr/lib/python2.4/site-packages/django/core/context_processors.py in auth, line 17 Patrick J. Anderson Patrick J. Anderson wrote: > In

User object available in base template

2006-10-03 Thread Patrick J. Anderson
In my project, I have a root template called base.html, which all other templates extend. I'd like to create a simple navigation with user information, which I want to write once and put in the base template to be shown on every page. I'm not sure what the best way of retrieving information

slug field and generic create view

2006-10-03 Thread Patrick J. Anderson
Is there a simple way to add the slug field to a custom form template? I'm using django.views.generic.create_update.create_object and my model has a slug field. Whenever I try to add a new item to database, I receive error saying that my "title" is similar to the on existing in the database,

Re: If drop the database (dropdb ) and rmdir the directory, is that it?

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 19:34 -0700, carlwenrich wrote: > In other words, is there anything else I need to do to remove a project? Did you modify the web server configuration file anywhere? Otherwise, that should be all you need to do. Regards, Malcolm > > > >

Re: Unicode and django/db/backends/util.py

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 19:27 -0700, Beau Hartshorne wrote: > On 3-Oct-06, at 6:56 PM, Malcolm Tredinnick wrote: > > > This probably isn't going to solve your problem, but it might help > > track > > down what is really happening... > > > > UnicodeDecodeError usually means that you are trying to

If drop the database (dropdb ) and rmdir the directory, is that it?

2006-10-03 Thread carlwenrich
In other words, is there anything else I need to do to remove a project? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: SET TIME ZONE Error

2006-10-03 Thread Malcolm Tredinnick
On Wed, 2006-10-04 at 00:41 +, gkelly wrote: > I am getting the following error when trying to call model.save() from > a custom Manipulator > > Traceback (most recent call last): [...] > ProgrammingError: ERROR: current transaction is aborted, commands > ignored until end of transaction

Re: Unicode and django/db/backends/util.py

2006-10-03 Thread Beau Hartshorne
On 3-Oct-06, at 6:56 PM, Malcolm Tredinnick wrote: > This probably isn't going to solve your problem, but it might help > track > down what is really happening... > > UnicodeDecodeError usually means that you are trying to use unicode > strings that haven't been converted to UTF-8 when they

Re: Handling phone extensions?

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 18:09 -0400, Fast, Adam wrote: > I’m working on an app and need a Phone number/extension. I’m using a > PhoneNumberField(), but was curious if there was a way to make an > extension field appear to the side. Is that part of the definition or > is there an easy way to get

Re: order admin list view

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 19:38 +, David S. wrote: > The docs say that, "regardless of how many fields are in ordering, the admin > site uses only the first field." To overcome this, I overrode the default > manager to return a queryset ordered by the fields I want. It works fine in > code

Re: Implementing entity relationships that use compound keys in a Django application

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 17:41 +0100, Sam Morris wrote: > Hello everyone! I am new to Django and am currently learning how to use > the model API. I am trying to construct a set of models to represent a > number of people (characters in a game), who can be members of one or > more organisations.

Re: Unicode and django/db/backends/util.py

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 08:15 -0700, Beau Hartshorne wrote: > On database updates, utf-8 strings like ’ raise an UnicodeDecodeError > exception on line 19 of util.py (version 0.9.5). I can get around > this by commenting out this code in util.py, but is there something > else I could do? > >

Re: migration from php and java

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 15:35 +0200, Aljosa Mohorovic wrote: > After some time with django i started porting current php/java > applications i use to django. > Please keep in mind that for duration of porting coexistence of > php/java/django is required. > That said, any help with current issue

Re: unique objects in list

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 18:21 +0400, Grigory Fateyev wrote: > Hello James Bennett! > On Tue, 3 Oct 2006 08:28:02 -0500 you wrote: > > > > > On 10/3/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote: > > > I have a list of ip in table, but this ip repeats many times. I > > > need to show each ip only

Re: ManyToManyFields are not syncdb'able

2006-10-03 Thread seemant
Andy, Duh on me :( Thanks for all your help with this -- it works beautifully now. My next challenge is date based generic views, but I'll open a new thread on that for archival's sake. Thanks again! Seemant --~--~-~--~~~---~--~~ You received this message

Re: 1-Many Display in the Admin Area .

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 06:37 -0700, MerMer wrote: > Alan, > > Thanks for helping out - but I'm more confused than ever. If Django > fields are required by default why use core=True at all? What do I > enter into the parameter so a field is NOT required. I tried null = > True and this didn't

Re: 1-Many Display in the Admin Area .

2006-10-03 Thread Malcolm Tredinnick
On Tue, 2006-10-03 at 08:26 -0400, Alan Johnson wrote: > 1. The objects are being displayed in the Admin area as > "Promoters" > and "Promotionss" - note the added "s". > > In Django it's convention to name models as singular nouns, not as > plural nouns. Change

Re: class with a ForeignKey and ManyToManyField, empty sql IN () clause after admin save

2006-10-03 Thread Russell Keith-Magee
On 10/4/06, L. Liddell <[EMAIL PROTECTED]> wrote: > > Any ideas? This is a known problem: http://code.djangoproject.com/ticket/2473 I believe that this is one of many tickets that will be addressed by Malcolm Treddinick's refactoring of the query system. Yours, Russ Magee %-)

SET TIME ZONE Error

2006-10-03 Thread gkelly
I am getting the following error when trying to call model.save() from a custom Manipulator Traceback (most recent call last): File "/usr/local/lib/python2.4/site-packages/django/core/servers/basehttp.py", line 272, in run self.result = application(self.environ, self.start_response)

User generated reports

2006-10-03 Thread Jaikumar
Hi All I am using Django and python to build a web based framework. My backend database is MySQL. So the users of this framework would like to create and use customizable reports. ex: If one of the tables in the MySQL DB is the results of a test plan execution, then the users would like to

Handling phone extensions?

2006-10-03 Thread Fast, Adam
I’m working on an app and need a Phone number/extension.  I’m using a PhoneNumberField(), but was curious if there was a way to make an extension field appear to the side.  Is that part of the definition or is there an easy way to get this accomplished?   Adam

class with a ForeignKey and ManyToManyField, empty sql IN () clause after admin save

2006-10-03 Thread L. Liddell
Here's a simplified version of what I need to accomplish: 1 from django.db import models 2 3 class Category(models.Model): 4 name = models.CharField(maxlength=255) 5 def __str__(self): 6 return self.name 7 class Admin: pass 8

Re: contrib comment system

2006-10-03 Thread Rob Hudson
I just worked on this last night. Actually, I copied the comments system to my project app folder and hacked it apart to support what I wanted it to do. I did that thinking that I'd leave the upgrade path open. Plus, I learned a lot about how comments work. I found this wiki page a good

Re: menu submenu system

2006-10-03 Thread Rob Hudson
I did something like this recently on a project. The way I approached it was to come up with a dataset that represented the menu at the template level with the various bits I needed to know in order to open another level, etc. Something like this: menu = [ {'title': title, 'url': url,

order admin list view

2006-10-03 Thread David S .
The docs say that, "regardless of how many fields are in ordering, the admin site uses only the first field." To overcome this, I overrode the default manager to return a queryset ordered by the fields I want. It works fine in code (interactively), but not in the admin view. Should it? Is

Re: Localizing dynamic content through the admin interface

2006-10-03 Thread Dirk Eschler
Am Dienstag, 3. Oktober 2006 19:32 schrieb Steven Armstrong: > On 10/03/06 19:14, Dirk Eschler wrote: > > Hello, > > > > please let me first point out that i'm new to Django. I have experience > > with gettext, but only in non-webapp environments. > > > > I've read through the i18n doc and am

Re: contrib comment system

2006-10-03 Thread Waylan Limberg
I was going to point you to the official docs [1], but that says it's not yet documented. That said, James Bennet did a nice writeup [2] that should get you going. [1]: http://www.djangoproject.com/documentation/add_ons/ [2]:

Re: contrib comment system

2006-10-03 Thread Adrian Holovaty
On 10/3/06, Onno Timmerman <[EMAIL PROTECTED]> wrote: > Is there somewhere some docs on the comment system in the contrib. Hi Onno, The comment system is undocumented at this point. As such, that means there's no guarantee it will stay in its current form. Adrian -- Adrian Holovaty

Re: Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread Waylan Limberg
On 10/3/06, James Bennett <[EMAIL PROTECTED]> wrote: > > I think maybe one thing we could do is build up a list of Python > tutorials and docs that we recommend people work through, either > before they start playing with Django or as they go. > +1 This seems to come up from time to time on the

Re: Localizing dynamic content through the admin interface

2006-10-03 Thread Steven Armstrong
On 10/03/06 19:14, Dirk Eschler wrote: > Hello, > > please let me first point out that i'm new to Django. I have experience with > gettext, but only in non-webapp environments. > > I've read through the i18n doc and am quite impressed about the gettext > support. I just wonder how you usually

Re: Mile-high view of Django

2006-10-03 Thread Tim Chase
>> http://simon.incutio.com/archive/2005/08/15/request > > For the detail-oriented folks, I also maintain a more in-depth version: > > http://www.b-list.org/weblog/2006/06/13/how-django-processes-request Yes, these were exactly the sort of thing I was hunting for--particularly the detailed

Filter types in Admin index view alterable?

2006-10-03 Thread mauiblu
Does anyone know if the filters available for the Admin index interface can be changed to select lists, for example? Or where these filter types are actually defined and what options are available? Thanks! JIm --~--~-~--~~~---~--~~ You received this message

Localizing dynamic content through the admin interface

2006-10-03 Thread Dirk Eschler
Hello, please let me first point out that i'm new to Django. I have experience with gettext, but only in non-webapp environments. I've read through the i18n doc and am quite impressed about the gettext support. I just wonder how you usually handle dynamic content. Clients/Users often want to

contrib comment system

2006-10-03 Thread Onno Timmerman
Is there somewhere some docs on the comment system in the contrib. Onno --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Implementing entity relationships that use compound keys in a Django application

2006-10-03 Thread Sam Morris
Hello everyone! I am new to Django and am currently learning how to use the model API. I am trying to construct a set of models to represent a number of people (characters in a game), who can be members of one or more organisations. Each person in an organisation has a rank in that organisation.

Re: Re: Mile-high view of Django (was "Re: Cannot get Many to Many Relationship To work...")

2006-10-03 Thread James Bennett
On 10/3/06, Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote: > This might help: > http://simon.incutio.com/archive/2005/08/15/request For the detail-oriented folks, I also maintain a more in-depth version: http://www.b-list.org/weblog/2006/06/13/how-django-processes-request -- "May

Re: Mile-high view of Django (was "Re: Cannot get Many to Many Relationship To work...")

2006-10-03 Thread Guillermo Fernandez Castellanos
Hi, This might help: http://simon.incutio.com/archive/2005/08/15/request Enjoy, G On 10/3/06, Tim Chase <[EMAIL PROTECTED]> wrote: > > >> Jay, I did read the documentation before jumping in - but > >> it's not all necessarily clear for someone who hasn't alot > >> of experience in Python of

Re: Mile-high view of Django (was "Re: Cannot get Many to Many Relationship To work...")

2006-10-03 Thread MerMer
> I keep learning little bits here and there as I encounter them, > but am having trouble fitting all the pieces together into a > cohesive big-picture. Like the person to whose post I'm > responding, I can read the docs, but extracting the big-picutre > (which in turn would help in knowing

Mile-high view of Django (was "Re: Cannot get Many to Many Relationship To work...")

2006-10-03 Thread Tim Chase
>> Jay, I did read the documentation before jumping in - but >> it's not all necessarily clear for someone who hasn't alot >> of experience in Python of Django. Are there any good resources where one can find the mile-high overview of Django's inner workings? An "executive summary", if you

Re: Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread James Bennett
On 10/3/06, MerMer <[EMAIL PROTECTED]> wrote: > Jay, I did read the documentation before jumping in - but it's not all > necessarily clear for someone who hasn't alot of experience in Python > of Django. This is a tough problem to deal with, though; at some point we have to be able to assume a

Re: Sample code for progress bar using patch 2070?

2006-10-03 Thread jacobm
I'm getting desperate and I don't have as much free time to spend on this as I'd like. Is anyone willing to share a sample upload app using the ajax component in exchange for a paypal donation? --~--~-~--~~~---~--~~ You received this message because you are

Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread MerMer
Jay, I did read the documentation before jumping in - but it's not all necessarily clear for someone who hasn't alot of experience in Python of Django. Because of my unfamiliarity I had presumed that all the classes in a single Models.py were immediately visible to each other. There is

Unicode and django/db/backends/util.py

2006-10-03 Thread Beau Hartshorne
On database updates, utf-8 strings like ’ raise an UnicodeDecodeError exception on line 19 of util.py (version 0.9.5). I can get around this by commenting out this code in util.py, but is there something else I could do? self.db.queries.append({ 'sql': sql % tuple(params),

Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread Jay Parlar
On 10/4/06, MerMer <[EMAIL PROTECTED]> wrote: > > Thanks Jay and Rajesh, > > I've just discovered this myself by switching the code around. This > is a real GOTCHA and not immediately obvious for a newbie like me. I > can't see anything in the documentation that mentions this - so I > presumed

Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread RajeshD
Just for posterity, I would like to say that this is indeed mentioned in the documentation here: http://www.djangoproject.com/documentation/model_api/#many-to-one-relationships Excerpt: "If you need to create a relationship on a model that has not yet been defined, you can use the name of the

Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread MerMer
Thanks Jay and Rajesh, I've just discovered this myself by switching the code around. This is a real GOTCHA and not immediately obvious for a newbie like me. I can't see anything in the documentation that mentions this - so I presumed it was a bug.

Re: unique objects in list

2006-10-03 Thread Grigory Fateyev
Hello James Bennett! On Tue, 3 Oct 2006 08:28:02 -0500 you wrote: > > On 10/3/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote: > > I have a list of ip in table, but this ip repeats many times. I > > need to show each ip only once with some statistic. How to do this? > >

Re: unique objects in list

2006-10-03 Thread RajeshD
> I have a list of ip in table, but this ip repeats many times. I > need to show each ip only once with some statistic. You will need some custom SQL to take care of the "statistics" you need for each distinct IP address. From what I understand of your problem, you need the result set from a

Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread Jay Parlar
On 10/4/06, MerMer <[EMAIL PROTECTED]> wrote: > > . > I am trying to create a many to many relationship between two classes > (Promotion and Category). > > When I add "categories = models.ManyToManyField(Category)" to the > Promotion class I get an errror saying "Category is not defined". > >

Re: Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread RajeshD
You are seeing that error because Category is defined after Promotion in your model file. In such cases, you can use string lookup instead a class lookup, like this: categories = models.ManyToManyField('Category') Note the Category in quotes instead of without quotes.

Re: DRY in templates

2006-10-03 Thread Slowness Chen
1. refactor the blocks you want into separate templates , do something like {%include 'block1.html'%} , {%include 'block2.html'%}. I guess this is what you want. or 2. "You can use as many levels of inheritance as needed." Luis P. Mendes wrote: > Hi, > > I have several applications running and

Cannot get Many to Many Relationship To work - "name" not defined error message

2006-10-03 Thread MerMer
. I am trying to create a many to many relationship between two classes (Promotion and Category). When I add "categories = models.ManyToManyField(Category)" to the Promotion class I get an errror saying "Category is not defined". However, when I add "promotions =

migration from php and java

2006-10-03 Thread Aljosa Mohorovic
After some time with django i started porting current php/java applications i use to django. Please keep in mind that for duration of porting coexistence of php/java/django is required. That said, any help with current issue (sharing users, auth. system, with php and java) is appreciated. I like

Re: 1-Many Display in the Admin Area .

2006-10-03 Thread MerMer
Alan, Thanks for helping out - but I'm more confused than ever. If Django fields are required by default why use core=True at all? What do I enter into the parameter so a field is NOT required. I tried null = True and this didn't work (and as an aside it made the red highlights on the

unique objects in list

2006-10-03 Thread Grigory Fateyev
Hello! I have a list of ip in table, but this ip repeats many times. I need to show each ip only once with some statistic. How to do this? In wich direction I should to look forward? filter, templatetag or something else? If it possible, share some code for example. -- ÷ÓÅÇÏ ÎÁÉÌÕÞÛÅÇÏ!

DRY in templates

2006-10-03 Thread Luis P. Mendes
Hi, I have several applications running and each of them has its own template files. They're working fine. Then, I decided that I should create another application that would merge all data information from each of those separated ones mentioned above. There were two problems to consider: 1-

Referencing the current URL in a view

2006-10-03 Thread DavidA
I have a number of views where function args (parsed from the URL conf) and/or query string arguments are used to filter the results that are displayed in a template. The template includes paging and sorting which need to use a URL that points back to the view using the same arguments, but I'm

Re: 1-Many Display in the Admin Area .

2006-10-03 Thread Alan Johnson
1.  The objects are being displayed in the Admin area as "Promoters" and "Promotionss" - note the added "s".In Django it's convention to name models as singular nouns, not as plural nouns. Change Promotions to Promotion and you'll get what you're expecting.  2.  I have added a core=True parameter

1-Many Display in the Admin Area .

2006-10-03 Thread MerMer
As a newbie I'm struggling to get to grips with Django's admin interface. I have created two tables (Promoter, Promotions) which have a straight forward 1-Many relationship. A couple of unexplained issues:- 1. The objects are being displayed in the Admin area as "Promoters" and "Promotionss"

Re: How to join 2 QuerySets? (with QuerySet object in result)

2006-10-03 Thread Laundro
I'm at work now, but have a look at Q(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send

Re: Help with related objects

2006-10-03 Thread Carlos Yoder
Just FYI, I cracked it myself.Me gets smarter! =)If anyone googles for this and is in a similar situation, pls let me know.On 10/3/06, Carlos Yoder <[EMAIL PROTECTED]> wrote: Hello all, I'm asking for help again, this time with related objects.I need to do what I think is a very simple task:

shared model relationship question

2006-10-03 Thread Benjamin Ward
Im very new to this so please forgive if this is an obvious question: How do you describe these relationships in a model in Django: 1) UserProfile extends User. UserProfile has_a Address. Event has_a Address. Where Address has a common data-structure shared by Event and UserProfile, but

Help with related objects

2006-10-03 Thread Carlos Yoder
Hello all, I'm asking for help again, this time with related objects.I need to do what I think is a very simple task: allow users to edit their own preferences (using a custom 'admin' like interface).Their own preferences are located in an extension of the User model, as follows: class

Re: Importing models from each other.

2006-10-03 Thread Gacha
I separated the models. Now I have myproj.extra which contains the Choice model and all works fine :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

menu submenu system

2006-10-03 Thread Onno Timmerman
I was wondering how you handle in Django a menu system with submenu's. For example I give my client the ability to make there own menu's. level1 level1 level2 level2 level3 level3 level2 level1 ... ... ... In the database I used table

Re: customizing the admin interface

2006-10-03 Thread Michael
On 10/3/06, Paul Barry <[EMAIL PROTECTED]> wrote: Is the admin interface customizable at all?  Specifically:1.  Can you create a workflow, like step 1, step 2, step 3, then save object?2.  Can you create a lookup select for a foreign key?  For example, if I have an object that has a ForeignKey and

Re: sharing session information with plone

2006-10-03 Thread spacedman
ashwoods wrote: > does anybody have experience of sharing session information from a > plone site. I want our intranet users that are authenticaded in plone > to be able to access django without having to relog. Haven't done this directly, but what you'd have to do is get the __ac cookie that