Re: TemplateSyntaxError in the admin pages

2010-04-05 Thread Martin Lundberg
Ah, great! Do you know the ticket or changeset for it? Curious to peek and learn a little :) On Mon, Apr 5, 2010 at 2:23 PM, Karen Tracey wrote: > 2010/4/5 Tomasz Zieliński > >> that 'raise wrapped' line is placed in catch-all handler, which >> >> means that >> probably some of your code called

Re: How to concatenate a list of Q objects?

2010-04-05 Thread Aaron
Sample.objects.filter(*qObjects) On Apr 6, 1:10 am, Daniel wrote: > Hi, I think that this must be super easy, but I'm kind of stumped. > > I have a list qObjects = [qObject1, qObject2, qObject3] > What I'd like is to form this query:  Sample.objects.filter(qObject1, > qObject2, qObject3) > > How

Re: How to concatenate a list of Q objects?

2010-04-05 Thread Masklinn
On 6 avr. 2010, at 07:10, Daniel wrote: Hi, I think that this must be super easy, but I'm kind of stumped. I have a list qObjects = [qObject1, qObject2, qObject3] What I'd like is to form this query: Sample.objects.filter(qObject1, qObject2, qObject3) How would I accomplish what I need? Than

How to concatenate a list of Q objects?

2010-04-05 Thread Daniel
Hi, I think that this must be super easy, but I'm kind of stumped. I have a list qObjects = [qObject1, qObject2, qObject3] What I'd like is to form this query: Sample.objects.filter(qObject1, qObject2, qObject3) How would I accomplish what I need? Thanks! -- You received this message because

Re: database engine problem

2010-04-05 Thread Shawn Milochik
Read the error you posted -- especially the last couple of sections, which repeatedly tell you exactly what the problem is. Shawn #kettlebell On Apr 6, 2010, at 12:29 AM, yangyang wrote: I followed the tutorial and set up the database engine as SQLight and it seemed to be successful. Howev

database engine problem

2010-04-05 Thread yangyang
I followed the tutorial and set up the database engine as SQLight and it seemed to be successful. However, when I try to do "python manage.py syncdb", it returns error message like File "manage.py", line 11, in execute_manager(settings) File "/Library/Frameworks/Python.framework/Versions/2.6

Re: Error when doing the tutorial

2010-04-05 Thread Marcos Marín
Make sure you have installed MySQLdb http://sourceforge.net/projects/mysql-python/ On Mon, Apr 5, 2010 at 21:31, John wrote: > Hello all, > > I am new to django and am doing the tutorial and when I run the > command below I get the following error. > > Does anyone know how to solve this? > > E:

Re: Models loading incorrectly

2010-04-05 Thread Kenneth Gonsalves
On Tuesday 06 Apr 2010 4:24:42 am Wedg wrote: > So has anyone ever heard of anything like this? Or should I start > posting code? > unless you post the code and the errors, it may be difficult to diagnose -- regards Kenneth Gonsalves Senior Associate NRC-FOSS http://certificate.nrcfoss.au-kbc.or

Error when doing the tutorial

2010-04-05 Thread John
Hello all, I am new to django and am doing the tutorial and when I run the command below I get the following error. Does anyone know how to solve this? E:\temp_dj_site\mysite>python manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings

Problems with model with optional FileField in Admin

2010-04-05 Thread Marcos Marín
Hi, So I have a site where I want the client to be able to add/remove links from a menu on the site through the admin site. Usually these links are to files on the server but not always. So I created a Link model which has a name, file and url field. The plan here is that if a file is given it's u

Mod_python error: AttributeError: 'str' object has no attribute 'status_code'

2010-04-05 Thread Nihaar Gupta
Help. I'm a bit of an apache/mod_python noob and am not sure what is causing this error. I get this at page load every so often (not all the time). Sometimes the page loads fine and sometimes it throws this exception. Guessing from the fact that this occurs only sometimes, perhaps this is a load/s

Missing Headers

2010-04-05 Thread Charlie
I setup my django App to run with Apache + MOD_WSGI, and now I'm have an odd problem where the Authorization HTTP Header if being dropped from the requestion. I'm using a custom Authorization header in my app and it worked find under the development server. I know apache is receiving the correct

Re: How to implement i18n in javascript

2010-04-05 Thread Steven Nien
Hi, Thanks everyone. I found the solution. The translation strings should be specified in "djangojs.po" not "django.po". On 4月5日, 下午11時12分, Vasil Vangelovski wrote: > Can you be more precise about what part doesn't work? Did you include > the javascript translation catalog in you HTML template

Re: Models loading incorrectly

2010-04-05 Thread Wedg
So I solved my own problem. Apparently querysets pass the db row as positional args, from which it constructs a new model instance. I had overridden __init__ on my model to take an extra argument, which was absorbing one of the positional args and 'causing the other values to get incorrectly assign

Re: Catching User's First Log in

2010-04-05 Thread Owen Nelson
Although, I guess you could argue that a proxy class with a @property method could achieve the same thing. from django.contrib.auth.models import User as DjangoUser class User(DjangoUser): class Meta: proxy = True @property def is_new(self): return None == self.last_log

Re: Catching User's First Log in

2010-04-05 Thread Owen Nelson
I guess it depends on the implementation of the auth backend you're using. Really though, it seems like using a bool flag involves less "magic", and is perhaps more descriptive than making assumptions based on timestamps. if user.is_new: redirect(somewhere) rather than... if user.last_login is Non

Models loading incorrectly

2010-04-05 Thread Wedg
So I've come across a weird bug... just wanted to see if anyone's ever heard of anything like it... I've got a set of models which appear to create/save correctly. For example, if I print mymodel.fkfield_id on the instance before/after save, it's A-OK. However, when I try to load the models again,

Re: Catching User's First Log in

2010-04-05 Thread Tim Shaffer
This might be slightly off topic, but why is the last_login set to the current date when a user is created? Wouldn't it make more sense for that date to be null until the user actually logs in? On Apr 5, 4:25 pm, Wesley Childs wrote: > Thanks for the advice. > > I'm going for boolean as I like t

Re: Newbie Issue: Creating a new django project

2010-04-05 Thread CLIFFORD ILKAY
On 04/05/2010 05:43 PM, Kartik wrote: I got it to work and the project to be created. Thanks Dennis for your suggestion. I am getting problems trying to sync db. My settings files are as follows: DATABASE_ENGINE = 'postgresql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' o

Re: Newbie Issue: Creating a new django project

2010-04-05 Thread Kartik
I got it to work and the project to be created. Thanks Dennis for your suggestion. I am getting problems trying to sync db. My settings files are as follows: DATABASE_ENGINE = 'postgresql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'postgres'

Re: conditional loading of template tags

2010-04-05 Thread Tim Shaffer
It's due to the way templates are parsed/rendered (obviously). The parser basically loops through all the tags/nodes in the template, and when it encounters an {% if %} tag, it attempts to parse all the tags/nodes inside the tag and returns that value. So basically the {% load %} tag and {% includ

Re: Hosting for Django sites

2010-04-05 Thread django_jedi
Thanks to all! Very helpful. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more

Re: Catching User's First Log in

2010-04-05 Thread Wesley Childs
Thanks for the advice. I'm going for boolean as I like the idea of flipping back on in the future for special events. Thanks Wes On 5 April 2010 21:06, Owen Nelson wrote: > > it does feel a little bit dirty to me. > Me too, that way leads to deciding something is a witch just because it > flo

Re: Catching User's First Log in

2010-04-05 Thread Owen Nelson
> it does feel a little bit dirty to me. Me too, that way leads to deciding something is a witch just because it floats. Can't argue with a Bool, and also, it might eventually be nice to be able to flip the bit on a whim (say a user wanted that "out of the box" experience all over again). --

Re: Catching User's First Log in

2010-04-05 Thread ShawnMilo
How about the last_login and date_joined fields in the User model? They're both set to the current date/time when the user is created. So, if the user's "first login" is when the account is created, you could check to see if they're less than a second apart. If the user is created automatically

Re: Catching User's First Log in

2010-04-05 Thread Dennis Kaarsemaker
On ma, 2010-04-05 at 20:50 +0100, Wesley Childs wrote: > I'm trying to catch the first time someone logs in so I can present > them with some options. I was wondering whether there is something > readily available in Django for this or whether I'll need to go down > the route of having a boolean f

Re: Catching User's First Log in

2010-04-05 Thread Owen Nelson
That would be the strategy I'd employ - however I'd recommend you not add the field to the user itself, but rather its profile. http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users -- You received this message because you are subscribed to the Google Groups

Re: Newbie Issue: Creating a new django project

2010-04-05 Thread Dennis Kaarsemaker
On ma, 2010-04-05 at 12:38 -0700, Kartik wrote: > python django-admin.py startproject django-test > python: can't open file 'django-admin.py': [Errno 2] No such file or > directory python c:\where\django\lives\django-admin.py startproject myproject (Don't put dashes in your projectname. It shoul

Catching User's First Log in

2010-04-05 Thread Wesley Childs
Hi all, I'm trying to catch the first time someone logs in so I can present them with some options. I was wondering whether there is something readily available in Django for this or whether I'll need to go down the route of having a boolean field on a user table that becomes un-checked after they

Newbie Issue: Creating a new django project

2010-04-05 Thread Kartik
Hi, I recently installed Django 1.1 using python setup.py install command. The django module was installed successfully. When I try to start a new project using django-admin, I get the following error. I am not sure what is happening. python django-admin.py startproject django-test python: can't

Newbie question regarding User and Anonymous user

2010-04-05 Thread zenr
Hi In my application, I used django-registration to allow users to login. Authenticated users can use all features of the site while Anonymous user should be able to use some portion of the site. When django makes a request for an authenticated user, it creates a request.user object that is deri

Re: global name 'self' is not defined

2010-04-05 Thread Bill Freeman
We need to see more of the template. You do know, for example, that you must provide your own form html tag? as_form only renders the input and select tags. Also, why do you think that your form constructor takes a "temsilci" keyword argument? Have you a custom __init__ that peels it out for som

Re: conditional loading of template tags

2010-04-05 Thread Owen Nelson
Tim Shaffer wrote: > I haven't tested this at all, but maybe try putting all the tagging > stuff, include {% load tagging_tags %}, in a separate template, then > wrapping the if statement around an include for that template: > > {% if object.tags %} > {% include "tag_stuff.html" %} > {% endif %}

Re: conditional loading of template tags

2010-04-05 Thread Tim Shaffer
I haven't tested this at all, but maybe try putting all the tagging stuff, include {% load tagging_tags %}, in a separate template, then wrapping the if statement around an include for that template: {% if object.tags %} {% include "tag_stuff.html" %} {% endif %} Like I said, I haven't tested t

Re: Dashboard plugin/widget development - create new post

2010-04-05 Thread Vinicius Mendes
This list is about Django, not PHP. __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Mon, Apr 5, 2010 at 1:23 PM, Jim N wrote: > Hi List, > > I thought this would be easy at first. Maybe it is. > > I am developing a dashboard widget that creates a post. Try

please ignore: Re: Dashboard plugin/widget development - create new post

2010-04-05 Thread Jim N
Apologies - I posted this to the wrong group! On Apr 5, 12:23 pm, Jim N wrote: > Hi List, > > I thought this would be easy at first.  Maybe it is. > > I am developing a dashboard widget that creates a post.  Trying to > emulate what QuickPress does, only the title is from a select box, > instead

Dashboard plugin/widget development - create new post

2010-04-05 Thread Jim N
Hi List, I thought this would be easy at first. Maybe it is. I am developing a dashboard widget that creates a post. Trying to emulate what QuickPress does, only the title is from a select box, instead of text input. Here is the form. It points at wp-admin/post.php. I get redirected to edit.

Re: How can i populate app engine(production environment) database with local sdk database

2010-04-05 Thread Roald de Vries
On Mar 31, 2010, at 9:12 AM, Eximius wrote: Please help me out On Mar 29, 11:04 pm, Eximius wrote: Hi all, I have created a django application using app engine sdk, and have stored data in database using forms. But the problem i am getting when i deploy it, the data I stored is not ther

conditional loading of template tags

2010-04-05 Thread onelson
So, I'm building an application that I'd like to be able to tie into django-tagging (if it's installed). Having an issue, probably best illustrated in code: http://dpaste.org/jaD8/ In my model, I have a tags property (obj.tags) which is None when 'tagging' is not in INSTALLED_APPS, otherwise it's

Re: How to implement i18n in javascript

2010-04-05 Thread Vasil Vangelovski
Can you be more precise about what part doesn't work? Did you include the javascript translation catalog in you HTML template with a

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Daniel Roseman
On Apr 5, 11:53 am, Willem wrote: > Thanks DR -- see below > > class ProfileManager(models.Manager): > >     def recently_added_people(self): >         cache_key = 'recently_added_people' >         profile_list = cache.get(cache_key) >         if profile_list is None: >             list = Profile.

Re: Tricky problem: database tables are not created

2010-04-05 Thread Torsten Bronger
Hallöchen! Karen Tracey writes: > [...] > > This is why the recommended approach is to put admin registrations > in admin.py files, and include a call to admin.autodiscover() in > urls.py. This ensures that all admin registrations are completed > before the URL for the first incoming request is r

Re: User profile form

2010-04-05 Thread Michał Klich
I managed to display form but with fields i`d like to not show or at least disable modifications, like username and email. Still would like some help on this . On Apr 2, 4:36 pm, Michał Klich wrote: > Thanks anyway :) > > I could create my own view and update respective database records but this

Re: Django-registration with django-profile

2010-04-05 Thread Praveen
Here i have done look at my blog http://praveensunsetpoint.wordpress.com/category/django/django-registration-profile/ On Apr 5, 1:03 am, Alessandro Ronchi wrote: > 2010/4/3 shacker : > > > Cool!  Would be nice to put your solution up on djangosnippets.org or > > similar for the benefit of others.

How to implement i18n in javascript

2010-04-05 Thread Steven Nien
I want to implement i18n in the javascript, but things just don't work here is my file tree: /home/myproject /home/myproject/app /home/static_media/test.js test.js: document.write(gettext('test_message_here')); Following is my procedure: 1. cd /home/myproject/app 2. mkdir locale 3. django-ad

Re: URL data in templatetags

2010-04-05 Thread Vinicius Mendes
You can try this: context['request'].GET It will work only if you are using RequestContext[1] or add the request to the template manually. It can be achieved either using generic views [2] or passing the context_instance parameter to the render_to_response [3]. I usually prefer to use direct_to_t

Re: Tricky problem: database tables are not created

2010-04-05 Thread Karen Tracey
On Mon, Apr 5, 2010 at 8:35 AM, Torsten Bronger < bron...@physik.rwth-aachen.de> wrote: > Hallöchen! > > Thierry Chich writes: > > > Is manage.py sqlall working ? > > Yes. > > I think I understood the problem now. It's a complicated case of a > cyclic import. If I have > > INSTALLED_APPS = (A, B

Re: Tricky problem: database tables are not created

2010-04-05 Thread Torsten Bronger
Hallöchen! Thierry Chich writes: > Is manage.py sqlall working ? Yes. I think I understood the problem now. It's a complicated case of a cyclic import. If I have INSTALLED_APPS = (A, B) then "manage.py syncdb" tries to generate the tables for A and imports A.models. The problem occurs if A

Re: TemplateSyntaxError in the admin pages

2010-04-05 Thread Karen Tracey
2010/4/5 Tomasz Zieliński > that 'raise wrapped' line is placed in catch-all handler, which > means that > probably some of your code called during template rendering is > broken, > Django catches it and re-raises as TemplateSyntaxError which, > unfortunately, > is vague about ther real problem.

Re: Tricky problem: database tables are not created

2010-04-05 Thread Thierry Chich
Is manage.py sqlall working ? Le 5 avr. 2010 à 14:03, Torsten Bronger aachen.de> a écrit : Hallöchen! Torsten Bronger writes: [...] But it gets even more strange: The models module of "chantal_ipv" imports models from "samples". I think this is the problem. If I comment out all calls t

Re: Tricky problem: database tables are not created

2010-04-05 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > [...] > > But it gets even more strange: The models module of "chantal_ipv" > imports models from "samples". I think this is the problem. If I > comment out all calls to admin.site.register in the models of > "samples", it works! WTF? I tracked the problem

URL data in templatetags

2010-04-05 Thread Anders Eide
Hello! How can i get information from request.GET in a inclusion tag? http://docs.djangoproject.com/en/1.1/howto/custom-template-tags/#inclusion-tags - Anders -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
Thanks DR -- see below class ProfileManager(models.Manager): def recently_added_people(self): cache_key = 'recently_added_people' profile_list = cache.get(cache_key) if profile_list is None: list = Profile.objects.order_by('-id').filter(

Re: Hosting for Django sites

2010-04-05 Thread JeffH
Valcato.com offers shared and dedicated hosting, including good Django support. I've got two Django sites with them now. Home office is in UK. --Jeff On Apr 4, 8:33 pm, Nick Lacey wrote: > Matt wrote: > >  plus im uk based so  phone wouldn't really help. > > Speaking of being UK based .. for the

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Daniel Roseman
On Apr 5, 10:42 am, Willem wrote: > If I unicode(the_list) in views.py -- the list becomes un-us able in > my template... > > See:  http://bit.ly/aXTW5pfor the error on my site It would be useful to see the definition of your Profile class - especially the __unicode__ method, if you have one. --

Tricky problem: database tables are not created

2010-04-05 Thread Torsten Bronger
Hallöchen! I have INSTALLED_APPS = ( "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.admin", "django.contrib.markup", "chantal_ipv", "chantal_common", "staticfiles", "samples", ) However, syncdb ignores chantal_

Re: TemplateSyntaxError in the admin pages

2010-04-05 Thread Martin Lundberg
Thanks Thomasz! You were correct. It was my __unicode__ function in my model which did something wrong. 2010/4/5 Tomasz Zieliński > > > On 5 Kwi, 10:25, Martin Lundberg wrote: > > > File "/home/marlun/.virtualenvs/django/lib/python2.6/site-packages/ > > django/template/debug.py" in render_node

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
If I unicode(the_list) in views.py -- the list becomes un-us able in my template... See: http://bit.ly/aXTW5p for the error on my site -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegro

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread ankit rai
from django.utils.encoding import * # views.py ## def country_detail(request, country_code): profiles = Profile.objects.filter(country__shortcode=country_code).filter(user__is_active='1') return render_to_response('people/country.html',{ 'country_code': country_code, 'country

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread ankit rai
from django.utils.encoding import * # views.py ## def country_detail(request, country_code): profiles = Profile.objects.filter(country__shortcode=country_code).filter(user__is_active='1') return render_to_response('people/country.html',{ 'country_code': country_code, 'country

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
ankit, I understand the error is related to unicode -- but it is not clear where the unicode() statement must go. Where in my code in views.py ## views.py ## def country_detail(request,country_code): profiles = Profile.objects.filter(country__shortcode=country_code).filter(user__is_active='1

Re: Hosting for Django sites

2010-04-05 Thread Vasil Vangelovski
I've nothing but positive impressions from Slicehost so far. - All their VPS plans (slices) work pretty fast and each is mostly limited by the amount of memory you need and are prepared to pay for. - Resizing a slice (changing a plan) is painless and fast. - You are the master of your own slice, n

Re: TemplateSyntaxError in the admin pages

2010-04-05 Thread Tomasz Zieliński
On 5 Kwi, 10:25, Martin Lundberg wrote: > File "/home/marlun/.virtualenvs/django/lib/python2.6/site-packages/ > django/template/debug.py" in render_node >   81.             raise wrapped > > Exception Type: TemplateSyntaxError at /admin/timetrack/work/ > Exception Value: Caught an exception whi

Re: decorators

2010-04-05 Thread Vasil Vangelovski
It's a deprecation warning. It means that some code in facebook.djangofb uses some part of the standard library that will be gone from future releases of python (for example python 2.7). Since it's not in your code but in some package you are using, it's the responsibility of the maintainers of tha

TemplateSyntaxError in the admin pages

2010-04-05 Thread Martin Lundberg
Hi, I've never gotten any errors when using the admin pages untill today. I am using Django 1.1. Not sure what information you guys need but here is the error: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/timetrack/work/ Django Version: 1.1.1 Python Version: 2.6.4 In

Re: error about django and mssql

2010-04-05 Thread Vasil Vangelovski
Well, the error message is pretty concise, a connection to the database server can't be opened. See if you can connect to the same database from the same machine with another client (for example Management Studio Express) to check if all the parameters in your connection string are correct. On Mon

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread ankit rai
use encoding method unicode(str).encde("UTF-8") On Mon, Apr 5, 2010 at 12:59 PM, Willem wrote: > I get following error: > > "Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode > character u'\xe1' in position 161: ordinal not in range(128)" > > > If I comment out the cache

ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
I get following error: "Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode character u'\xe1' in position 161: ordinal not in range(128)" If I comment out the cache line in template -- all is OK Any ideas? Many thanks - DETAIL: Line 24 in template below: 23