Re: explanation of: {{ action.action_time|date:_("DATETIME_FORMAT") }}

2009-08-18 Thread Ali Rıza Keleş
Please look up at the top of your codes, i think you'll see something like this: from django.utils.translation import ugettext_lazy as _ That's it!.. -- Ali Rıza On Tue, 2009-08-18 at 15:08 -0700, Margie Roginski wrote: > I was trying to figure out how to run the date filter, using >

Form upload passed to ftp method

2009-08-18 Thread Jonathan
I am trying to write a view that will take a file uploaded via form, pass it to an ftp method and save it on an ftp server. However I am running into problems when with the file object that gets passed to the ftp method. This is my view: def order_prints(request, object_id): p =

Re: Transactions in Django

2009-08-18 Thread Lokesh Maremalla
It seems that we have to mention both the calls (commit & rollback) for every @transaction.commit_manually decorator. One single function call won't be sufficient to perform the operation. On Tue, Aug 18, 2009 at 11:08 PM, Lokesh wrote: > > Hi, > > Verified the flow

Re: render_to_response fails with TemplateSyntaxError: too many values to unpack

2009-08-18 Thread girzel
On Wed, Aug 19, 2009 at 8:30 AM, Janne Peltola wrote: > > Template rendering fails when both form data and a tuple are passed to > render_to_response. > > Python: 2.6.2; Django: 1.1; Environment: Windows + built-in dev server > > I use the standard

Error in setting up psycopg2

2009-08-18 Thread Simon Lee
I am trying to set up a simple test website in the Apache Server that comes with OSX 10.5.8 and continuously ran into errors that complainted about not able to import something in pscycopg2. The site works if I ran with the django development server. When I port to Apache, it did not work. Can

Re: PIL & imagefield validation

2009-08-18 Thread Malcolm MacKinnon
For what it's worth, here's what helped me about a month ago. The PIL installation process is a mess, and I had to follow these instructions, step by step. I think I've fixed the problem. It had to so with PIL not being installed correctly. Check out this link:

Re: PIL & imagefield validation

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 4:44 PM, zayatzz wrote: > > Buh... well instructions for installing & compiling ship with the > software. Can you tell me how to uninstall those modules? > Not a clue. You can start in site-packages or go into the shell and type import PIL

Re: Raw Strings with Variables

2009-08-18 Thread WilsonOfCanada
However, when I send the list over as a dictionary for HTML: d["places"] = arrPlaces return render_to_response('rentSearch.html', d) the HTML using Django has: {{ places }} but returns ['C:\\moo', 'C:\\supermoo'] --~--~-~--~~~---~--~~ You received this message

render_to_response fails with TemplateSyntaxError: too many values to unpack

2009-08-18 Thread Janne Peltola
Template rendering fails when both form data and a tuple are passed to render_to_response. Python: 2.6.2; Django: 1.1; Environment: Windows + built-in dev server I use the standard django.contrib.auth.models.User and .Group models. View: class FuksiForm(forms.Form): ryhmat =

Re: Database design question

2009-08-18 Thread ringemup
Well, I'm trying to implement parent / child aliases, but I'm running into problems with class declaration order because I need to reference the Alias class from within the Account class as well as referencing Account from Alias for validation purposes -- and not just in ForeignKey declarations

Re: Django and CouchDB

2009-08-18 Thread Russell Keith-Magee
On Tue, Aug 18, 2009 at 11:12 PM, sjtirtha wrote: > Yes, > > I do have interest to help on Object non-Relational Mapper. > Does Django has a kind of interfaces, where I can implement my own Object > non-Relational Mapper and inject it to Django? I don't want to seem rude, but

Re: Why using ForeignKey and not OneToOne to extend the user profile?

2009-08-18 Thread Kenneth Gonsalves
On Tuesday 18 Aug 2009 7:27:58 pm Léon Dignòn wrote: > Why should I use a ForeignKey if I want my user profile extended? If > the reverse side will return a single object, I could spare a little > > bit of code, if I just write: > >>> "User.objects.get(username='Leon').avatar" > > instead of > >

Re: Database design question

2009-08-18 Thread Joshua Russo
On Tue, Aug 18, 2009 at 8:26 PM, ringemup wrote: > > I have accounts that can have multiple aliases, but each account must > have a primary alias. I can think of two ways to institute this, but > they both have problems: > > 1) reference the primary alias from the account: >

Re: How do you remove a manytomany relationship in django?

2009-08-18 Thread Daniel Roseman
On Aug 18, 9:49 pm, Ray wrote: > I know in the backend, a manytomany relationship is essentially a join > table, but there seems to be no easy way to delete relationships from > it. The only remove option is made only for ForeignKey relationships. > Is there a workaround?

Re: explanation of: {{ action.action_time|date:_("DATETIME_FORMAT") }}

2009-08-18 Thread Ramiro Morales
On Tue, Aug 18, 2009 at 7:08 PM, Margie Roginski wrote: > > I was trying to figure out how to run the date filter, using > SETTINGS.DATETIME_FORMAT as an argument. > > When I grepped in the admin app I found this in object_history.html: > > {{

Re: i18n javascript problem

2009-08-18 Thread Antoni Aloy
2009/8/18 caiobos : > > Hello! > My project is alredy working with i18n, but the i18n js doesnt work. > I have created my dir locale at the root of the project, have run > makemessages and it create the djangojs.po correcty. With compile > messages I get the djangojs.mo ok. >

Re: Database design question

2009-08-18 Thread Joshua Russo
Yup, that could work too. Let me know what you end up with. On Tue, Aug 18, 2009 at 9:58 PM, ringemup wrote: > > > Yes, I think that does make sense. Thank you! > > While pondering this, I also came up with a third option, which is to > make the alias data part of the

Re: How do you remove a manytomany relationship in django?

2009-08-18 Thread Daniel Roseman
On Aug 18, 9:49 pm, Ray wrote: > I know in the backend, a manytomany relationship is essentially a join > table, but there seems to be no easy way to delete relationships from > it. The only remove option is made only for ForeignKey relationships. > Is there a workaround?

Re: Flatpages - what am I missing to make these work (advice, please)?

2009-08-18 Thread alain31
I just had the same problem, because my site.id was not 1 but 2 as I discovered with the shell... On 18 août, 22:24, gegard wrote: > > I cannot get flatpages to work on my site > > ... which, I should have said, is in Django 1.1. > > Geoff

Problem with "Cancel" button

2009-08-18 Thread David
Hello, I have a "Cancel" button on one of my Webpages. The button sometimes works as expected, sometimes it does not. After the button has been clicked, it is supposed that the webpage is re-directed to another page. However, this re-direction seems not work all the time. Following is my script.

Re: Using fixtures in tests

2009-08-18 Thread marekw2143
Yes, you're right. I just assumed that if the info about loading initial_data is printed that there will be printed info for non- initial-data fixtures too. On Aug 17, 11:53 am, Karen Tracey wrote: > On Mon, Aug 17, 2009 at 11:10 AM, Marek Wawrzyczek >

How to use inlineformset with a manytomany relationship

2009-08-18 Thread Andew Gee
Hi, Is there a way to create an inlineformset for two models with manytomany relationship. I have created: class Person(models.Model): name = models.CharField phone= models.ManyToMany(Phone) class Phone(models.Model): PHONE_CHOICES(('H','Home'),('W",'Work'),('M','Mobile'))

explanation of: {{ action.action_time|date:_("DATETIME_FORMAT") }}

2009-08-18 Thread Margie Roginski
I was trying to figure out how to run the date filter, using SETTINGS.DATETIME_FORMAT as an argument. When I grepped in the admin app I found this in object_history.html: {{ action.action_time|date:_("DATETIME_FORMAT") }} Can anyone give me a pointer as to how this works? What is '_' in this

Re: error message in admin

2009-08-18 Thread Marek Palatinus
On Tue, Aug 18, 2009 at 4:45 PM, Marek Palatinus wrote: > On Tue, Aug 18, 2009 at 4:36 PM, Joshua Russo wrote: >> On Tue, Aug 18, 2009 at 1:23 PM, Marek Palatinus wrote: >>> >>> On Tue, Aug 18, 2009 at 12:22 PM, Joshua

Re: Database design question

2009-08-18 Thread ringemup
Yes, I think that does make sense. Thank you! While pondering this, I also came up with a third option, which is to make the alias data part of the Account model, and allow Accounts to have parent accounts; then only accounts with no parents are permitted to be assigned to users. (Also

how to access ForeignKey models properties?

2009-08-18 Thread onoxo
this is my model.py: class Event(models.Model): title = models.CharField('Event Name', max_length=300) photo_set = models.ForeignKey(PhotoSet, blank=True, null=True) class PhotoSet(models.Model): title = models.CharField(max_length=300) slug = models.CharField(max_length=300)

How do you remove a manytomany relationship in django?

2009-08-18 Thread Ray
I know in the backend, a manytomany relationship is essentially a join table, but there seems to be no easy way to delete relationships from it. The only remove option is made only for ForeignKey relationships. Is there a workaround? Why would django design a relationship that you can only add

Re: PIL & imagefield validation

2009-08-18 Thread zayatzz
Buh... well instructions for installing & compiling ship with the software. Can you tell me how to uninstall those modules? Alan. On Aug 18, 11:40 pm, Michael wrote: > On Tue, Aug 18, 2009 at 4:37 PM, zayatzz wrote: > > > Nobody knows? Any wild

Check server type at runtime?

2009-08-18 Thread ringemup
Is there any way to check at runtime whether Django is running on the development server? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Database design question

2009-08-18 Thread ringemup
I have accounts that can have multiple aliases, but each account must have a primary alias. I can think of two ways to institute this, but they both have problems: 1) reference the primary alias from the account: class Account(models.Model): ... primary_alias =

Multiple pagination on a sinle page.

2009-08-18 Thread Sonal Breed
Hi all, In my application, I want to have pagination for multiple objects (Friends, Stories) on a single page. Problem is if I click next on one of the paginated objects, all the paginated objects on the page move to next page. How do I accomplish individual pagination on a single page for

Re: PIL & imagefield validation

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 4:37 PM, zayatzz wrote: > > Nobody knows? Any wild guesses? Cause im all out of ideas. > > Alan. > > On Aug 17, 9:24 pm, zayatzz wrote: > > Hello > > > > On sunday i had problems with python when i installed stackless

Re: PIL & imagefield validation

2009-08-18 Thread zayatzz
Nobody knows? Any wild guesses? Cause im all out of ideas. Alan. On Aug 17, 9:24 pm, zayatzz wrote: > Hello > > On sunday i had problems with python when i installed stackless > python. Now i have compiled and installed : > setuptools & python-mysqldb and i got my

Re: Flatpages - what am I missing to make these work (advice, please)?

2009-08-18 Thread gegard
> I cannot get flatpages to work on my site ... which, I should have said, is in Django 1.1. Geoff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Creating apps that can be easily migrated to subdirectories

2009-08-18 Thread Javier Guerra
On Tue, Aug 18, 2009 at 1:14 PM, Sydney Weidman wrote: > > On Aug 18, 11:57 am, Javier Guerra wrote: >> On Tue, Aug 18, 2009 at 11:49 AM, Sydney Weidman wrote: >> > I'm moving some Django applications that used to be served from the >> > root of

Re: Get results from query depending on another query

2009-08-18 Thread Jonas Obrist
course = Course.objects.filter(group__user=request.user) Chris McComas wrote: > I have a model that has a FK to django.contrib.auth.models Group. I > run a query that gets all the groups that a user is a member of: > > groups = Group.objects.filter(user=request.user) > > Then I want to run a

Re: Get results from query depending on another query

2009-08-18 Thread Daniel Roseman
On Aug 18, 8:28 pm, Chris McComas wrote: > I have a model that has a FK to django.contrib.auth.models Group. I > run a query that gets all the groups that a user is a member of: > > groups = Group.objects.filter(user=request.user) > > Then I want to run a query for that

Re: template syntax

2009-08-18 Thread Margie
I would convert your dictionary to a list of tuples. IE, in your views.py code studentTuples = [(student, dictionary.student.id) for student in students] Now in your template, to print out lines containing: student name: student id you can do this: {% for studentTuple in studentTuples %}

Get results from query depending on another query

2009-08-18 Thread Chris McComas
I have a model that has a FK to django.contrib.auth.models Group. I run a query that gets all the groups that a user is a member of: groups = Group.objects.filter(user=request.user) Then I want to run a query for that model that gets and entries in that model where the group FK is one of the

Re: Exception in transaction block hidden by "InternalError: transaction aborted ..." exception

2009-08-18 Thread Darren
any thoughts on this? thanks, darren On Aug 17, 2:57 pm, Darren wrote: > Hi > > My app saves data in a method with "@transaction.commit_manually". > > My code had a bug - a field in a model was the wrong datatype for what > was passed in, so I got a DataError

Re: Why using ForeignKey and not OneToOne to extend the user profile?

2009-08-18 Thread Alex Gaynor
On Tue, Aug 18, 2009 at 8:57 AM, Léon Dignòn wrote: > > Hello, > > in the authentication documentation is written that the user profile > should be extended with a foreign key. > > - >

Re: Problem installing Django 1.1 on XP

2009-08-18 Thread Alex Gaynor
2009/8/18 Nikola Smiljanić : > > I installed Django 1.1 on my Windows 7 machine with 64bit Python 2.6.2 > without any problems, but now I tried to install it on Windows XP with > Python 2.6.2 and here is what I get: > > D:\Django-1.1>python setup.py install > Traceback (most

Re: Creating apps that can be easily migrated to subdirectories

2009-08-18 Thread Sydney Weidman
On Aug 18, 11:57 am, Javier Guerra wrote: > On Tue, Aug 18, 2009 at 11:49 AM, Sydney Weidman wrote: > > I'm moving some Django applications that used to be served from the > > root of the site to a sub-URL like /apps. Do I have to change every > > template that

i18n javascript problem

2009-08-18 Thread caiobos
Hello! My project is alredy working with i18n, but the i18n js doesnt work. I have created my dir locale at the root of the project, have run makemessages and it create the djangojs.po correcty. With compile messages I get the djangojs.mo ok. The problem is how i confgure it in URLconf, if i

Re: Transactions in Django

2009-08-18 Thread Lokesh
Hi, Verified the flow of statements for the posted code. Still the problem exists. Code works fine when I handled the transactions in general functions but not with the views. Could someone please clarify me on these 1. Can I use the transaction decorators(@transaction.commit_manually) for

Flatpages - what am I missing to make these work (advice, please)?

2009-08-18 Thread gegard
I cannot get flatpages to work on my site, although I have done all that I can see in the documentation, and would like guidance. I give a 6-step short description of what I've done and what happened, in case anyone recognizes a glaring mistake or lack in what I've done. Step 6 is it just 'not

Re: Creating apps that can be easily migrated to subdirectories

2009-08-18 Thread Javier Guerra
On Tue, Aug 18, 2009 at 11:49 AM, Sydney Weidman wrote: > I'm moving some Django applications that used to be served from the > root of the site to a sub-URL like /apps. Do I have to change every > template that contains a reference to /app1/blah to /apps/app1/blah in > every

Creating apps that can be easily migrated to subdirectories

2009-08-18 Thread Sydney Weidman
Hi! I'm moving some Django applications that used to be served from the root of the site to a sub-URL like /apps. Do I have to change every template that contains a reference to /app1/blah to /apps/app1/blah in every template? Is there a centralized/better/prescribed way to do this? - Syd

Re: template syntax

2009-08-18 Thread mettwoch
See this: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for There's an example of iterating over key, value pairs Marc On Aug 18, 5:48 pm, elminio wrote: > I iterate through all students and have distionary containing students > ids as key and for

Re: site and username unique together

2009-08-18 Thread Fredde
I have solved this. If anyone is interested, this is how I did... Instead of having username and site as two separate fields, I combined them. This will make the username unique for each site. The username field will look like this ":". Since this isn't very nice to display I wrote some methods

OK to put app_directories before filesystem template loader?

2009-08-18 Thread ke1g
I find myself wanting to place the app_directories template loader before the filesystem template loader in settings.TEMPLATE_LOADERS, so that when I clone an app to, among other things, modifiy its templates, I get mine instead of the default. I'm wondering if anyone knows of reasons not to

Re: template syntax

2009-08-18 Thread elminio
sorry: I pass this dictionary to the TEMPLATE --~--~-~--~~~---~--~~ 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,

Re: template syntax

2009-08-18 Thread elminio
I iterate through all students and have distionary containing students ids as key and for example grade as a value. I pass this dictionary to the view and then while iterating through all students I though that it would be simple to get appropriate value for current student. I dont know how I

Re: template syntax

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 11:16 AM, elminio wrote: > > Thanks for such a quick reply > > and what is i iterate through for example students > > {% for student in students %} > {{ dictionary.student.id }} > {% endfor %} > > I want to have student.id as a key and in the way

Re: Seamless integration of customized forms in my project

2009-08-18 Thread Thierry
You sold me on "this construction is unclear" and the "happy debugging" is scaringly convincing. I will stick with different classnames approach, with maintenance and portability (reusing apps) in mind. Thank you for your time. --~--~-~--~~~---~--~~ You received

Re: OT: Drawing lines in the browser

2009-08-18 Thread Chris McCormick
On Tue, Aug 18, 2009 at 07:40:00AM -0700, Ian McDowall wrote: > On Aug 18, 8:53 am, Thomas Guettler wrote: > > Hi, > > > > this is offtopic: How can you draw lines in a (django) web application? > > > > I think you need to use flash or java to do it. I googled for it, but

Re: template syntax

2009-08-18 Thread elminio
Thanks for such a quick reply and what is i iterate through for example students {% for student in students %} {{ dictionary.student.id }} {% endfor %} I want to have student.id as a key and in the way I did it above it doesnt work because dicttionary wants student as a key :) thanks for

Re: Django and CouchDB

2009-08-18 Thread sjtirtha
Yes, I do have interest to help on Object non-Relational Mapper. Does Django has a kind of interfaces, where I can implement my own Object non-Relational Mapper and inject it to Django? Regards, Steve On Tue, Aug 18, 2009 at 3:17 PM, Russell Keith-Magee wrote: > >

Ordering a django change list page via jQuery?

2009-08-18 Thread Niall Mccormack
I would like to be able to reorder lists of Models via a jQuery script. I already have reordering within inLines on the Model update page, but I'd like to add it to the change_list page aswell? Is this possible? I'm using Django 1.1 so have access to action sheets, if that makes things

Re: Transactions in Django

2009-08-18 Thread TiNo
On Tue, Aug 18, 2009 at 16:19, Lokesh wrote: > > Hi, > > Unable to perform rollback the transactions. Ended up with the > following error > "Transaction managed block ended with pending COMMIT/ROLLBACK" > > Can I rollback the db changes even if the code doesn't raise

Re: template syntax

2009-08-18 Thread mettwoch
Use: {% name_of_your_dictionary.key_you_want_to_access %} Remember that templates use the '.' (dot) to access keys, attributes, indexes ... Kindly Yours Marc On Aug 18, 4:55 pm, elminio wrote: > Hi, > > Im passing to the template dictionary and I would like to get by

Re: template syntax

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 10:55 AM, elminio wrote: > > Hi, > > Im passing to the template dictionary and I would like to get by key > to the value of that dictionary and if the key doesnt exist in it > insert blank field into html > > thank You very much for help The

template syntax

2009-08-18 Thread elminio
Hi, Im passing to the template dictionary and I would like to get by key to the value of that dictionary and if the key doesnt exist in it insert blank field into html thank You very much for help --~--~-~--~~~---~--~~ You received this message because you are

Problem with Django/Jython and Postgres backend

2009-08-18 Thread Brandon Taylor
Hi everyone, I'm getting this exception with the latest Django-Jython and Jython2.5: wks-btaylor:test_project btaylor$ jython manage.py runserver Validating models... Unhandled exception in thread started by Traceback (most recent call last): File

Re: Aggregation on expressions

2009-08-18 Thread mettwoch
The whole thing behind that it is: I'm developing an invoicing/ inventory application and I run into performance problems that might require using raw SQL and admittedly I'm not an SQL expert and I dislike the idea of doing so. I thought more on an approach of "SQL view" than denormalisation or

Re: error message in admin

2009-08-18 Thread Marek Palatinus
On Tue, Aug 18, 2009 at 4:36 PM, Joshua Russo wrote: > On Tue, Aug 18, 2009 at 1:23 PM, Marek Palatinus wrote: >> >> On Tue, Aug 18, 2009 at 12:22 PM, Joshua Russo >> wrote: >> > On Tue, Aug 18, 2009 at 8:52 AM, Marek Palatinus

Re: OT: Drawing lines in the browser

2009-08-18 Thread Ian McDowall
On Aug 18, 8:53 am, Thomas Guettler wrote: > Hi, > > this is offtopic: How can you draw lines in a (django) web application? > > I think you need to use flash or java to do it. I googled for it, but found > only beta > quality projects. > > Has anyone experience with this?

Re: The admin interface - this used to work?

2009-08-18 Thread Marek Palatinus
>  1. I have moved to the production server, and django is invoked with > apache & mod_wsgi (previously used the dev server). When using dev server, django serve all admin static files for you. Im not absolutely sure, but when you switch from dev server to another (im using fastcgi), you have to

Re: The admin interface - this used to work?

2009-08-18 Thread Sean Kemplay
I had a similar problem after updating the django version. I had custom admin templates based on the previous version. Copying the latest versions accross fixed it for me. Regards, Sean On Tue, 2009-08-18 at 07:18 -0700, Joakim Hove wrote: > Hello, > > I am slowly building up a site with

Re: error message in admin

2009-08-18 Thread Joshua Russo
On Tue, Aug 18, 2009 at 1:23 PM, Marek Palatinus wrote: > > On Tue, Aug 18, 2009 at 12:22 PM, Joshua Russo > wrote: > > On Tue, Aug 18, 2009 at 8:52 AM, Marek Palatinus > wrote: > >> > >> Hello, > >> > >> Im doing some validation

Re: Seamless integration of customized forms in my project

2009-08-18 Thread Marek Palatinus
On Tue, Aug 18, 2009 at 4:14 PM, Thierry wrote: > Should I stick with custom class names and refer to them throughout my > project instead? > Thanks for any feedback, > Thierry. > Hi, from side of python syntax, it is possible. See this example: mar...@kraksna:~/$ python

Re: error message in admin

2009-08-18 Thread Marek Palatinus
On Tue, Aug 18, 2009 at 12:22 PM, Joshua Russo wrote: > On Tue, Aug 18, 2009 at 8:52 AM, Marek Palatinus wrote: >> >> Hello, >> >> Im doing some validation in ModelAdmin.save_model(). I can cancel >> operation (just dont call parent method), but I also

Problem installing Django 1.1 on XP

2009-08-18 Thread Nikola Smiljanić
I installed Django 1.1 on my Windows 7 machine with 64bit Python 2.6.2 without any problems, but now I tried to install it on Windows XP with Python 2.6.2 and here is what I get: D:\Django-1.1>python setup.py install Traceback (most recent call last): File "setup.py", line 69, in version

Transactions in Django

2009-08-18 Thread Lokesh
Hi, Unable to perform rollback the transactions. Ended up with the following error "Transaction managed block ended with pending COMMIT/ROLLBACK" Can I rollback the db changes even if the code doesn't raise any excceptions? Here is the code: from django.db import transaction

The admin interface - this used to work?

2009-08-18 Thread Joakim Hove
Hello, I am slowly building up a site with django - it feels very good. About two months ago I tried the admin interface; with nearly zero effort (basically uncomment a couple of lines from the default files) I got a very nice and functional interface up and running - great! Now I have done

Seamless integration of customized forms in my project

2009-08-18 Thread Thierry
(Please excuse my meaningless title as English is not my natural language). I would like some advice on how pythonic/heretic my approach is. What I am trying to do is: - subclass standard Form class (e.g to add new rendering methods) - subclass some fields and widgets (e.g to add custom CSS

Re: Aggregation on expressions

2009-08-18 Thread Russell Keith-Magee
On Tue, Aug 18, 2009 at 9:21 PM, mettwoch wrote: > > Hi, > > Some time ago I asked if there is a way to aggregate on an expression > and I was told that it's not possible at the moment. I managed to use > a mix of aggregation and some arithmetics to reduce processing time by > a

Why using ForeignKey and not OneToOne to extend the user profile?

2009-08-18 Thread Léon Dignòn
Hello, in the authentication documentation is written that the user profile should be extended with a foreign key. - http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users "If you'd like to store additional information related to your users, Django

RichTextEditor

2009-08-18 Thread chinny
hai, can anyone sugget me how to work on RichTexEditor. I actually i tried but couldn't get the excat thing what i want. i have downloaded the richtext app from google and i put in my project folder and i'm extending the fileds from there to my models.py In my models.py from richtext.fields

Re: programmatically changing language problem

2009-08-18 Thread stanleyxu2005
I have solved this problem myself. I have to declare the following variable: LANGUAGES = ( ('de', 'German (Deutsch)'), ('en', 'English'), ) And then include the middleware "django.middleware.locale.LocaleMiddleware" On Aug 18, 11:20 am, stanleyxu2005 wrote: > Hi

Re: How to extend Auth/User in admin view?

2009-08-18 Thread Léon Dignòn
Forget my previous post. Now that I got it working I have one more question! (btw, I needed to restart the server for the changes to take effect) This is my code: from django.contrib import admin from myproject.myapp.models import Car, Manufacturer, UserProfile from

Aggregation on expressions

2009-08-18 Thread mettwoch
Hi, Some time ago I asked if there is a way to aggregate on an expression and I was told that it's not possible at the moment. I managed to use a mix of aggregation and some arithmetics to reduce processing time by a factor of 20 in critical areas of my application. While doing so, I felt that

Re: Django and CouchDB

2009-08-18 Thread Russell Keith-Magee
On Tue, Aug 18, 2009 at 7:40 PM, Joshua Partogi wrote: > > > On Tue, Aug 18, 2009 at 8:17 PM, sjtirtha wrote: >> >> Hi, >> >> i found some Python API to access couchDB. >> I'm asking here for experience. > > Django model is really tight to RDBMS. You

Re: Model instance refreshing

2009-08-18 Thread mettwoch
Oooh, obvious! It requires alot of changes, but I think I'll do it. Thanks Colin Marc On Aug 17, 10:43 pm, Colin Bean wrote: > On Mon, Aug 17, 2009 at 1:31 PM, mettwoch wrote: > > > Hi, > > > I use a session to store several instances of different models

Clarification required on one-to-one save method

2009-08-18 Thread bvemu
Hi All To maintain a 1-1 relation with User table I have defined the following in my models class UserDetails(models.Model): user_id = models.OneToOneField(User, primary_key=True, parent_link=True) choices= models.PositiveSmallIntegerField(null=False, blank=False,

Re: Admin add / list / etc links broken?

2009-08-18 Thread ringemup
Ah - thank you! I knew I was doing something stupid. On Aug 17, 10:16 pm, Ramiro Morales wrote: > On Mon, Aug 17, 2009 at 8:39 PM, ringemup wrote: > > > I'm sure I'm doing something wrong, but I can't figure out what. The > > list, add, and change links

Re: Django and CouchDB

2009-08-18 Thread Sam Lai
Would be easy enough if you just wanted to use the routing, views and template parts of Django though. Sorry, no experience though something that I've been wanting to try for a while. Unfortunately, the current project doesn't call for that kind of db. 2009/8/18 Joshua Partogi

Re: Django and CouchDB

2009-08-18 Thread Joshua Partogi
On Tue, Aug 18, 2009 at 8:17 PM, sjtirtha wrote: > Hi, > > i found some Python API to access couchDB. > I'm asking here for experience. > Django model is really tight to RDBMS. You are going to have a hard time making django model work with non-RDBMS --

Re: model get_absolute_url strange behaviour

2009-08-18 Thread andreas schmid
Daniel Roseman wrote: > On Aug 18, 11:08 am, andreas schmid wrote: > >> hi to all, >> >> i have a weird problem with my urls. >> >> my model has a get_absolute_url like this: >>* def get_absolute_url(self): >> return "%s/%s/" % (self.pub_date.strftime("%Y"),

Re: model get_absolute_url strange behaviour

2009-08-18 Thread Daniel Roseman
On Aug 18, 11:08 am, andreas schmid wrote: > hi to all, > > i have a weird problem with my urls. > > my model has a get_absolute_url like this: >    * def get_absolute_url(self): >         return "%s/%s/" %  (self.pub_date.strftime("%Y"), self.slug )* > > and the url conf

Re: error message in admin

2009-08-18 Thread Joshua Russo
On Tue, Aug 18, 2009 at 8:52 AM, Marek Palatinus wrote: > > Hello, > > Im doing some validation in ModelAdmin.save_model(). I can cancel > operation (just dont call parent method), but I also need to show some > error message to user. Im able to call self.message_user() and

Re: Django and CouchDB

2009-08-18 Thread sjtirtha
Hi, i found some Python API to access couchDB. I'm asking here for experience. Regards, Steve On Tue, Aug 18, 2009 at 5:08 AM, 邓超 wrote: > You can google it. I have read once, but forget the link address now. > > 2009/8/18 sjtirtha > > Hi, >> >> can

model get_absolute_url strange behaviour

2009-08-18 Thread andreas schmid
hi to all, i have a weird problem with my urls. my model has a get_absolute_url like this: * def get_absolute_url(self): return "%s/%s/" % (self.pub_date.strftime("%Y"), self.slug )* and the url conf is this one: *(r'^(?P\d{4})/(?P[-\w]+)/$', 'myapp.views.projects.project_detail',

error message in admin

2009-08-18 Thread Marek Palatinus
Hello, Im doing some validation in ModelAdmin.save_model(). I can cancel operation (just dont call parent method), but I also need to show some error message to user. Im able to call self.message_user() and show INFO message, but how to send ERROR message and maybe show form back and force user

programmatically changing language problem

2009-08-18 Thread stanleyxu2005
Hi All, after reading the django documentation, I still have problem with changing a language. I have create two languages: en_US and de_DE If I declare LANGUAGE_CODE='de_DE' in settings.py (without the middleware django.middleware.locale.LocaleMiddleware), my project will be translated into

Re: ways to implement a user - profile page

2009-08-18 Thread Berislav Lopac
On Aug 18, 2:49 am, Nicolas Aggelidis wrote: > Thank you for your comments! > > > First, there is no need to have the username in the URL if this page > > is visible only to the logged-in user. Instead, use the request.user > > object inside your view (and, if necessary,

Re: Logging mechanism in Django

2009-08-18 Thread slafs
Hi! Found this about django-logging also... http://ericholscher.com/blog/2008/aug/29/screencast-2-logging-fun-and-profit/ Regards On Aug 18, 12:30 am, Rafael Ferreira wrote: > the problem is that logging to a file is not going to work in a multiprocess > environment. I'm

Re: OT: Drawing lines in the browser

2009-08-18 Thread Chris Withers
Thomas Guettler wrote: > Hi, > > this is offtopic: How can you draw lines in a (django) web application? > > I think you need to use flash or java to do it. I googled for it, but found > only beta > quality projects. > > Has anyone experience with this? Depends on why you want to draw

Re: How to extend Auth/User in admin view?

2009-08-18 Thread Léon Dignòn
Hi Daniel, I have trouble doing this: 1. admin.site.unregister(User) does not remove User from the admin interface. It is still visible. I removed all code and used only this line and the import... line. Nothing happens. 2. Is this code correct? from django.contrib import admin from

Re: Django model register for admin section

2009-08-18 Thread vijay kumar
Hi, I tried it but ended up with some problem . Let me try it once again with Thanks Ajay On Tue, Aug 18, 2009 at 1:59 PM, Alex Gaynor wrote: > > On Tue, Aug 18, 2009 at 3:28 AM, ajay wrote: > > > > Hi , > > To register model in admin

  1   2   >