Re: one inconsistent place between django document and source code.

2010-08-10 Thread Yangmin Li
thanks

On Tue, Aug 10, 2010 at 8:04 PM, Karen Tracey  wrote:

> On Mon, Aug 9, 2010 at 1:49 AM, yangmin...@gmail.com  > wrote:
>
>> Hi All,
>>When I was reading django document, I also viewed the source code
>> of the framework to help me understand,
>>but I found one inconsistent place about urls attribute of
>> Django's AdminSite object.
>>
>># in djangoproject document,
>> http://docs.djangoproject.com/en/dev/topics/http/urls/:
>> ** This will include the nominated URL patterns into the given
>> application and instance namespace. For example, the urls attribute of
>> Django's AdminSite object returns a 3-tuple that contains all the
>> patterns in an admin site, plus the name of the admin instance, and
>> the application namespace admin.
>># in source code:  /django/contrib/admin/options.py
>>
> [code snipped]
>
> Note options.py is defining the urls method for a ModelAdmin object.
>
> The urls method for an AdminSite is in sites.py:
>
>
> http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/contrib/admin/sites.py#L242
>
> Karen
> --
> http://tracey.org/kmt/
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Daniel França
thanx, I'll look at that =)

On Tue, Aug 10, 2010 at 12:31 PM, Xavier Ordoquy wrote:

> It is a bit trickier.
> Pinax application gets all their dependancies through pip installation and
> requirement files.
> If you have a pinax application, take a look in the requirements directory.
> You'll find two files (base.txt and project.txt) that tell exactly what
> application to get and what versions are needed.
> Pinax does all the bootstrap processing, so once you installed a pinax
> application, you already have a working environment.
>
> Your application is based on the same common set with Pinax application.
> However, if you copied the code, you didn't went thought pinax bootstraping
> operations which would have installed all the required applications with the
> correct versions.
> It happens that I am unable to make your application work on osx and Linux
> with the latest stable django-timezones (0.1.x).
> However, using the version that Pinax requires (0.2.dev1) it works on both
> linux and osx.
> However, you may find other differences if your environments are different.
> Please google for virtualenv and pip to get the same environment on your
> various development boxes as well as your production ones and enjoy
> virtualenv, pip, Python, Django, OSX and Linux :)
>
> Regards,
> Xavier.
>
> Le 10 août 2010 à 17:12, Daniel França a écrit :
>
> *I bet you installed pinax on your linux box but not on your osx one (or
> not in the same virtual env).*
> *hmmm, I just copied the code from Linux to OSX, is it what you mean? I
> should have "install" Pinax, that's it?*
>
> On Tue, Aug 10, 2010 at 12:05 PM, Xavier Ordoquy wrote:
>
>>
>> Actually, it doesn't work on Linux either with the same settings.
>> Please update django-timezones to 0.2.dev2 which is what pinax uses (pip
>> install 
>> --extra-index-url=http://dist.pinaxproject.com/dev/django-timezones==0.2.dev1).
>>  The latest stable doesn't seem to work with
>> django 1.2.
>> I bet you installed pinax on your linux box but not on your osx one (or
>> not in the same virtual env).
>>
>> Regards,
>> Xavier.
>>
>> Le 10 août 2010 à 15:42, Daniel França a écrit :
>>
>> I'm not blaming OSX.
>> I just said that it was working on Linux, and now it's not working on Mac.
>> and even if my code is wrong that shouldn't be that dificulty to find the
>> error, doesn't agree? A more clear error message would help.
>> The problem isn't the error, but we are about a month arguing about this
>> error, and I'm sure the error message isn't clear enough.
>> Maybe it's a silly mistake, but I think I should receive a message that
>> clearly say me that.
>>
>>
>> On Tue, Aug 10, 2010 at 10:35 AM, Xavier Ordoquy wrote:
>>
>>>
>>> Le 10 août 2010 à 15:10, Daniel França a écrit :
>>>
>>> It's very useful Andy, sympathy is welcome =)
>>> I was programming under linux, and I guessed that would be really
>>> straight forward port my project to OSX, I was wrong :(
>>>
>>>
>>> You know you are unfair. Unless you have strong evidence, you shouldn't
>>> blame osx for mistakes you probably made.
>>> Actually, your code doesn't work at all.
>>> I just gave a try on ubuntu 9.10/Django 1.2/sqlite DB and got the same
>>> error as I have on OSX (Error binding parameter 1 - probably unsupported
>>> type.).
>>>
>>> Regards,
>>> Xavier.
>>>
>>> --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> You 

Re: include(admin.site.urls)

2010-08-10 Thread Michael P. Soulier
On 10/08/10 Karen Tracey said:

> does not work properly. You also have to change the first element of the
> tuple:
> 
> (r'^admin/', include(admin.site.urls)),

*sigh* Thanks, that was it.

Mike
-- 
Michael P. Soulier 
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein


signature.asc
Description: Digital signature


Re: do QuerySet joins still suck?

2010-08-10 Thread Phlip
>  orders = Order.objects.filter(
>    pk=42,
>    order_items__product='whiteboards'
>    )
>
> Is this not what you want?

We made a feeb attempt at that and gave up. Thanks! I will try it next.

The next question, if it works, will be how to values_list() a field
from a child record; it might follow that notation.

Could I trouble you for its home page? Googling for [django queryset
join] gives zillions of newbs trying simple queries...

-- 
  Phlip
  http://c2.com/cgi/wiki?ZeekLand

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Reporting Library??

2010-08-10 Thread ydjango
I need a reporting library for web based (HTML) reporting with support
for standard features
1) header
2) footer
3) pagination
4) Totals/summary


Reportlab is too low level for my needs and their pro version license
does not work for me.

Is there any other good python based reporting library.

My only option at this time is JasperReports which is java based which
would be an overkill.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: do QuerySet joins still suck?

2010-08-10 Thread Tim Chase

On 08/10/10 18:39, Phlip wrote:

The point of a relational database is to distribute everything
into normalized tables, then perform set operations on
multiple tables.

Given an Order model with many order_items, other ORMs allow
me to query them like this (in a hypothetical notation):

Order.objects.filter(pk=42).join('order_items').filter(product='whiteboards')


Given that you don't actually include your models, it sounds like 
you're doing something like


  orders = Order.objects.filter(
pk=42,
order_items__product='whiteboards'
)

Is this not what you want?

-tkc


--
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Language code after logout - Django ignores settings.language_code?

2010-08-10 Thread Stodge
I have internationalisation working in 1.1.1. When I logout and get re-
directed to the login screen, the language code is always 'en'
regardless of settings.language_code. Is this the expected behaviour?

I realise I'm using an older version but I have no control over the
server.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



do QuerySet joins still suck?

2010-08-10 Thread Phlip
The point of a relational database is to distribute everything into
normalized tables, then perform set operations on multiple tables.

Given an Order model with many order_items, other ORMs allow me to
query them like this (in a hypothetical notation):

 
Order.objects.filter(pk=42).join('order_items').filter(product='whiteboards')

I have googled around and found only Order.extra(), which neglects the
has-many relationship, then forces you to verbosely restate it.

I'm going with raw SQL; this post is just to make sure nothing has
arisen very recently, or if I overlooked something obvious...

--
  Phlip
  http://bit.ly/ZeekLand

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: New server set up

2010-08-10 Thread Scott Hebert (slaptijack)
Python 2.4 is the default version that ships with RHEL / CentOS 5.x.

On Aug 9, 4:27 pm, Boguslaw Faja  wrote:
> why are you using python in version 2.4? It's a bit old.

--
Scott Hebert
http://slaptijack.com

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Graham Dumpleton


On Aug 11, 7:43 am, Colleen A Josephson  wrote:
> That does exactly what I need, thank-you!
> 
> From: django-users@googlegroups.com [django-us...@googlegroups.com] On Behalf 
> Of Michael [newmani...@gmail.com]
> Sent: Tuesday, August 10, 2010 5:25 PM
> To: django-users@googlegroups.com
> Subject: Re: SSL with Django, Apache, mod_wsgi and nginx
>
> On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson 
> > wrote:
> Unfortunately I'm not very well versed in proxying and SSL, etc.
> I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

Not a case of eliminating it, with nginx as front end proxy as
described in that blog post and with nginx handling HTTPS and Apache
only receiving requests as HTTP, you cant use SSLRedirect in Apache
because Apache will only ever see it as HTTP and using that directive
will cause a redirect loop. Thus instead of SSLRedirect, with that
configuration, you must use the equivalent in nginx as someone
described below.

BTW, the tip of tricking Django into thinking request is via HTTPS
even though it only handles it as HTTP is important. Instead of their
suggestion of modifying WSI script however, I would just use:

  SetEnvIf X-Forwarded-Protocol "^https$" HTTPS=on

With either fixup in place, you could also perhaps in Django
application use one of the methods available for check if connection
is_secure and redirecting if not.

Graham

> I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
> am not redirected to https:// as I would like to be.
>
> It would be much more efficient to redirect from nginx than django here. Just 
> implement something like this on your server that runs on port 80 (http):
>
> location /admin/ {
>      rewrite (.*)  https://$server_name$1 permanant;
>
> }
>
> This is just a snippit I just wrote. Let me know if it doesn't work, I will 
> actually go and run it.
>
> hope that helps,
>
> Michael
>
> --
> 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 options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django not creating intermediary tables for m2m relations

2010-08-10 Thread bksfu
Hi Xavier,

I had dropped my tables earlier, so this wasn't the problem.
Everything
was being created afresh, although there were existing tables in the
DB
that had nothing to do with my models.  All my existing tables had
different names
than the ones in my models.

On Aug 7, 2:55 am, Xavier Ordoquy  wrote:

> This will often happen when you have both model table created in the database 
> and then you add some field and syncdb.
> Syncdb will not perform operation on tables that are already created, 
> including created new fields or intermediate tables.
> However, if you start from scratch, this should be fine.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



base url not displaying

2010-08-10 Thread tomfmason
Sorry for the non-descriptive title..

This is somewhat of an odd issue. First off, I am working with django
1.1.1 with apache proxing to CherryPY WSGIServer. Here is all of the
code in question - http://pastie.org/1084870.

When I access the wsgiserver directly everything works as expected.
However, when I access the project via apache(proxied to the
wsgiserver) the base url does not call myproject.store.views.home but
instead it simply renders my base.html template. This is troublesome
because I have no view which simply renders the base.html template.

As I stated when I access the project directly via the wsgiserver it
works as expected and when I access it via apache the base url(home
page) does not load correctly. Although, when behind apache, every
other url works as expected.

Any debugging suggestions would be great.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to limit entries from each user to a specific number N (N > 1)?

2010-08-10 Thread Andy
I have an application that's similar to the typical Q system.

A user asks a question. other users submit answers to that question:

- Each user is allowed to submit up to N answers to each question,
where N > 1 (so, say each user can submit no more than 3 answers to
each question)
- A user can edit his existing answers, or submit new answer(s) if he
hasn't already reached his limit.

It's straightforward to do this if each user is allowed only 1 answer
- just do:
unique_together = (("user.id", "question_id"),)
But in case of N>1, what is the best way to implement this?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django - Datagrid

2010-08-10 Thread Tom
Bjorn,

I got this working. The way I fixed it was..

I downloaded jqGrid again and selected all the libraries to be
included. My guess is that navGrid isn't bundled with the core grid. I
dont know this for sure. Its working for me now.

Tom

On Jun 19, 3:59 pm, Bjørn Høj Jakobsen  wrote:
> Hi
>
> Is there anybody who has implemented jqqrid 3.7 with json and made it
> work?.
>
> I keep getting an error from FF
>
> Error: uncaught exception: jqGrid - No such method:navGrid
>
> http://127.0.0.1:8000/static/jquery/js/
> jquery-1.4.2.min.js"> http://127.0.0.1:8000/static/jquery/js/jquery-
> ui-1.8.2.custom.min.js"> 
> 
> http://127.0.0.1:8000/static/jqgrid/js/i18n/grid.locale-
> en.js" type="text/javascript">
> http://127.0.0.1:8000/static/jqgrid/js/
> jquery.jqGrid.min.js" type="text/javascript">
> http://127.0.0.1:8000/static/jqgrid/src/grid.jqueryui.js";
> type="text/javascript">
> http://127.0.0.1:8000/static/jqgrid/src/
> ui.multiselect.js" type="text/javascript">
>
> js looks like this:
>
> jQuery("#list2").jqGrid({ url:'/xhr_test', dataType: "json",
>
>                          colNames:['Country Name', 'Country Code',
> 'Nationality Code','Added Date'],
>                          colModel:[
>
> {name:'countryname',index:'countryref', width:90},
>
> {name:'countrycode',index:'countrycode', width:100},
>
> {name:'nationalitycode',index:'nationalitycode', width:80,
> align:"right"},
>
> {name:'added_date',index:'added_date', width:80, align:"right"} ],
> rowNum:10, rowList:[10,20,30], pager: '#pager2', sortname: 'id',
> viewrecords: true, sortorder: "desc", caption:"JSON Example" });
>
> jQuery("#list2").jqGrid('navGrid','#pager2',
> {edit:false,add:false,del:false});
>
> Regards
>
> Bjørn

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread cootetom
You could try using the set_language redirect view to set your
language 
http://docs.djangoproject.com/en/1.1/topics/i18n/internationalization/#the-set-language-redirect-view




On Aug 10, 8:12 pm, Renne Rocha  wrote:
>   I don't know if it will help you, but reading the chapter of
> internationalization in the book "The Definitive Guide To Django" I saw this
> paragraphs:
>
>   LocaleMiddleware tries to determine the user's language preference by
> following this alghorithm:
>
>   - First it looks for a django_language key in the current user's section
>   - Failing that, it looks for a cookie called django_language
>   - Failing that, it looks the Accept-Language HTTP header. This header is
> sent by your browser and tells the server which language(s) you prefer, in
> order of priority. Django tries each language in the header until it finds
> one with available translations.
>   - Failing that, it uses the global LANGUAGE_CODE setting.
>
>   I haven't tried, but it seems that the LANGUAGE_CODE is the last setting
> that Django will use to determine what language the site will appear
>
>   Say me if it helps you. Please.
>
>   Renne Rocha
>   renne.ro...@gmail.com
>  http://www.linkedin.com/in/rennerocha
>   +55 19 8154-9345
>
>
>
> On Tue, Aug 10, 2010 at 3:11 PM, kostia  wrote:
> > I have a web site. It iswww.projector.net.ua. Sometimes it is down.
> > I have the latest code herehttp://github.com/vaxXxa/projectorof it.
> > I have installed rosetta module to translate the English version of my
> > site into Russian and Ukrainian. I did this. You may see it in
> > projector/locale folder.
> > I setup my settings.py to use 'ru' language just for test.
>
> > You can see my base.html file which is getting LANGUAGE_CODE var
> > always as 'en', however in settings.py i did specify the 'ru' one.
>
> > I have read docs and djangobook (the same as docs, but more
> > comfortable as it is displayed on one single page) for several times
> > and I can't understand why my site is still in English.
>
> > I guess some guru can look at the code above and find an error. If I
> > will be so lucky)
>
> > --
> > 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 > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
That does exactly what I need, thank-you!

From: django-users@googlegroups.com [django-us...@googlegroups.com] On Behalf 
Of Michael [newmani...@gmail.com]
Sent: Tuesday, August 10, 2010 5:25 PM
To: django-users@googlegroups.com
Subject: Re: SSL with Django, Apache, mod_wsgi and nginx

On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson 
> wrote:
Unfortunately I'm not very well versed in proxying and SSL, etc.
I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
am not redirected to https:// as I would like to be.

It would be much more efficient to redirect from nginx than django here. Just 
implement something like this on your server that runs on port 80 (http):

location /admin/ {
 rewrite (.*)  https://$server_name$1 permanant;
}

This is just a snippit I just wrote. Let me know if it doesn't work, I will 
actually go and run it.

hope that helps,

Michael

--
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Michael
On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson wrote:

> Unfortunately I'm not very well versed in proxying and SSL, etc.
> I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.
>
> I implemented the Lincoln Loop setup, but if I go to the http:// admin
> page I am not redirected to https:// as I would like to be.
>

It would be much more efficient to redirect from nginx than django here.
Just implement something like this on your server that runs on port 80
(http):

location /admin/ {
 rewrite (.*)  https://$server_name$1 permanant;
}

This is just a snippit I just wrote. Let me know if it doesn't work, I will
actually go and run it.

hope that helps,

Michael

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: custom vocabularies vs translation

2010-08-10 Thread bobhaugen
On Aug 9, 5:01 pm, cootetom  wrote:
> Using the language files is the solution here. Even if your site only
> supports the English language, it still means that you can have .po
> files for just English. Once you understand how it all hangs together
> you'll be away.

Thanks alot.

Did a test run on a small project; worked very smoothly.

Working on large project, very tedious finding and marking up all the
required strings, but expect it will work equally well in the end.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and WebShell

2010-08-10 Thread mike171562
anyone?

On Aug 6, 2:42 pm, Support Desk  wrote:
> I'm trying to setup Webshell in one of my Django Password protected pages.
> Webshell is a python script which starts its own server and your designated
> port it displays a shell on ava enabled web browser that connect to
> localhost. It tests good when i display it with an Iframe
>
> http://webshellurl.net:9881; width="100%" height="300">
> 
>
> But i would like to set it up so that you have to be logged into my django
> app to view it. I can start the webshell on the localhost interface, but
> that wouldn't work with an Iframe tag. Is there a django way to connect the
> server and display the contents on my django protected page?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
Unfortunately I'm not very well versed in proxying and SSL, etc. 
I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
am not redirected to https:// as I would like to be.

From: django-users@googlegroups.com [django-us...@googlegroups.com] On Behalf 
Of Michael [newmani...@gmail.com]
Sent: Tuesday, August 10, 2010 3:00 PM
To: django-users@googlegroups.com
Subject: Re: SSL with Django, Apache, mod_wsgi and nginx

On Tue, Aug 10, 2010 at 2:49 PM, Colleen A Josephson 
> wrote:
I just set up a site that uses nginx to server static media and Apache/mod_wsgi 
to deal with the Django stuff.

How would I go about dealing with SSL? Would the setup be on the nginx end or 
the Apache end? Could I still use SSLRedirect middleware?

Thanks,
-Colleen


There isn't really much of a need for SSLRedirect Middleware with WSGi any 
more. This setup is really a nice one IMO. Thanks to Lincoln Loop for  putting 
it up: http://lincolnloop.com/django-best-practices/deployment/servers.html

Hope that helps,
Michael

--
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-tables with ID

2010-08-10 Thread Nick
You could just write the table out in full in the template and use
JavaScript to sort the rows.



On Aug 10, 2:55 pm, "Mike W."  wrote:
> Hi,
>
> I'm trying to use django-tables to display the output in a grid-like
> view.  I'd like a user to be able to choose a row and send it to a
> detail page.
>
> I've tried to look for a way to pass the ID across, but I can't seem
> to find much about it.  Is it possible, and if so, how?  Is there
> something else out there that might work better?
>
> Thanks!

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MultiPartParserError HTTP_CONTENT_LENGTH zero when uploading a file

2010-08-10 Thread hcarvalhoalves
I'll try running under Cherokee + uWSGI and see if the problem shows
up again. Something tells me this is related to FCGI...

It's still hard to separate the false positives though. If a user
stops a upload, you see the exact same traceback.

On Aug 10, 12:47 pm, Roger  wrote:
> I'm seeing the same symptoms.  The rate is much lower than 1 in 5 -
> maybe 1 in 100 - but definitely the same error.  Were you guys able to
> make any progress on a solution?
>
> On Aug 4, 1:17 am, hcarvalhoalves  wrote:
>
>
>
> > Now that someone else mentioned, yes, I believe we have the same
> > problem.
>
> > I run Django thru FastCGI to a Cherokee Web Server, and occasionally,
> > uploads fail to continue (the traceback shows that the code hanged at
> > consuming the input stream, then the connection got reset by the
> > client's browser, raising EOFError).
>
> > At first, I filled a bug against Cherokee, but it didn't turned out
> > that we were able to narrow the issue. Now I know it's not related to
> > the web server, as you run Lighttpd.
>
> > The only things I can think of are, a bug on FastCGI (Flup), Django,
> > or a bug only triggered when you run Django thru FastCGI.
>
> > I've also ran my Django install with SCGI, and with different options
> > (fork / threaded), but the intermittent error persists. SCGI still
> > uses Flup though.
>
> > This bug proved to be really, really hard to reproduce or track down.
> > I only get it because I run a SaaS with dozens users uploading photos
> > every day, and some requests happen to fail starting the upload and
> > end 500'ing.
>
> > What about filling a ticket against Django?
>
> > On 2 ago, 18:49, Eric Chamberlain  wrote:
>
> > > We have an intermittent problem when uploading files.  About one in five 
> > > uploads fails, when the MultiPartParser receives an HTTP_CONTENT_LENGTH 
> > > of zero.
>
> > > We are running Django with lighttpd and fastcgi, has anyone else 
> > > encountered this problem?
>
> > > --
> > > Eric Chamberlain

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



problem with a formset from model

2010-08-10 Thread refreegrata
Hello list. I have a problem. I'm a newbie in Django using his first
formset.

I have this:

class BaseFormFormato_habilitar(BaseModelFormSet):
def __init__(self, *args, **kwargs):
super(BaseFormFormato_habilitar, self).__init__(*args,
**kwargs)
self.queryset = Formato.objects.filter(actividad=True)

FormFormato_habilitar = modelformset_factory(Formato, max_num=0,
formset=BaseFormFormato_habilitar)


I want a formset with forms filtered for
"Formato.objects.filter(actividad=True)", however, the formset always
returns all the rows in the table. My alternatively subclass
"BaseFormFormato_habilitar" don't works. What am I doing wrong?
the problem is solved if i do "FormFormato_habilitar(queryset =
Formato.objects.filter(actividad=True))" in a view, but i prefer solve
the problem with a subclass in the "forms.py".

thanks for read, and sorry for my poor english

P.D.: I use Django 1.2.1

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



dynamic forms and custom methods

2010-08-10 Thread lingrlongr
I 'm trying to create a form dynamically.  This works just fine, but
there's no way for the form to offer any customized validation, by way
of the clean() method.

def get_dept_weight_form(store):
fields = {}
s = Store.objects.get(pk=store.id)
for d in store.department_set.all():
fields['id_%d' % d.id] = forms.DecimalField(
label = d.name,
initial = d.weight
)
return type('WeightForm', (forms.BaseForm,), {'base_fields':
fields})

Basically, this form spits out a label showing the department name and
the weight for you to enter in a textbox.  The weights for all
departments should total 1.0.  Should a clean() method handle this?

I already use an overridden version of save() on the store model, but
that just prints out a warning to stdout.  Also, I have this
validation for the admin part by overriding the clean method for my
declared ModelForm.

Perhaps I should just use the functionality I already created in
models.py and just raise a ValidationError?

Thx

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
I just found out Modeltranslation does not support ImageField :-(

http://code.google.com/p/django-modeltranslation/issues/detail?id=30

On Aug 10, 10:01 pm, grimmus  wrote:
> I am doing it in the admin area, so i dont have any custom code.
>
> The issue might be with the Modeltranslation module. It creates extra
> columns for the different translations, so, for example, title has
> title, title_en, title_fr as rows in the DB. This applies to the image
> field too.
>
> Thanks for any further guidance.
>
> On Aug 10, 9:55 pm, wayne  wrote:
>
> > What is the code that you are using to save instances of the model
> > with?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
I am doing it in the admin area, so i dont have any custom code.

The issue might be with the Modeltranslation module. It creates extra
columns for the different translations, so, for example, title has
title, title_en, title_fr as rows in the DB. This applies to the image
field too.

Thanks for any further guidance.

On Aug 10, 9:55 pm, wayne  wrote:
> What is the code that you are using to save instances of the model
> with?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django-tables with ID

2010-08-10 Thread Mike W.
Hi,

I'm trying to use django-tables to display the output in a grid-like
view.  I'd like a user to be able to choose a row and send it to a
detail page.

I've tried to look for a way to pass the ID across, but I can't seem
to find much about it.  Is it possible, and if so, how?  Is there
something else out there that might work better?

Thanks!

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread wayne
What is the code that you are using to save instances of the model
with?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



'module' object has no attribute 'instancemethod' error

2010-08-10 Thread Wim Feijen
Hi,

When using reportlab trying to import a file which contains the
following line, I get an error.

from reportlab.platypus import Paragraph

The error says:
ViewDoesNotExist at /
Tried book in module book.address.views. Error was: 'module' object
has no attribute 'instancemethod'

The trace is below.

What could be wrong?

Wim



Environment:

Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.0.3 pre-alpha SVN-10924
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.flatpages',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'book.address',
 'book.adyen',
 'book.birthday',
 'book.budget',
 'book.export',
 'book.event',
 'book.field',
 'book.files',
 'book.friend',
 'book.help',
 'book.importbook',
 'book.login',
 'book.management',
 'book.password',
 'book.preferences',
 'book.create_pdf',
 'book.registration',
 'book.search',
 'book.tag',
 'book.write']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.common.CommonMiddleware')


Traceback:
File "/home/wim/myprojects/book/django/core/handlers/base.py" in
get_response
  82. request.path_info)
File "/home/wim/myprojects/book/django/core/urlresolvers.py" in
resolve
  183. sub_match = pattern.resolve(new_path)
File "/home/wim/myprojects/book/django/core/urlresolvers.py" in
resolve
  124. return self.callback, args, kwargs
File "/home/wim/myprojects/book/django/core/urlresolvers.py" in
_get_callback
  136. raise ViewDoesNotExist, "Tried %s in module %s.
Error was: %s" % (func_name, mod_name, str(e))

Exception Type: ViewDoesNotExist at /
Exception Value: Tried book in module book.address.views. Error was:
'module' object has no attribute 'instancemethod'

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
Thanks for the reply, below is my Project model

from django.db import models

class Project(models.Model):
title = models.CharField(max_length=100)
path = models.CharField(max_length=100,help_text='This should be
the folder name')
image = models.ImageField(upload_to='/images/projects/')
date = models.DateField(help_text='The projects are ordered by
date')
active = models.BooleanField()

def __unicode__(self):
return u'%s' %(self.title)

On Aug 10, 9:24 pm, wayne  wrote:
> > When i try and add a project  in the admin i get the error: 'unicode'
> > object has no attribute '_committed' . I'm quite certain it's an issue
> > with the image field.
>
> Well, not to be coy, but you have a unicode string somewhere whose
> _committed value you are trying to access.  Problem is, the unicode
> string does not have this particular value/method.
>
> That's what I'm guessing without seeing the code, anyway.
>
> Wayne

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'unicode' object has no attribute '_committed'

2010-08-10 Thread wayne
> When i try and add a project  in the admin i get the error: 'unicode'
> object has no attribute '_committed' . I'm quite certain it's an issue
> with the image field.

Well, not to be coy, but you have a unicode string somewhere whose
_committed value you are trying to access.  Problem is, the unicode
string does not have this particular value/method.

That's what I'm guessing without seeing the code, anyway.

Wayne

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread Renne Rocha
  I don't know if it will help you, but reading the chapter of
internationalization in the book "The Definitive Guide To Django" I saw this
paragraphs:

  LocaleMiddleware tries to determine the user's language preference by
following this alghorithm:

  - First it looks for a django_language key in the current user's section
  - Failing that, it looks for a cookie called django_language
  - Failing that, it looks the Accept-Language HTTP header. This header is
sent by your browser and tells the server which language(s) you prefer, in
order of priority. Django tries each language in the header until it finds
one with available translations.
  - Failing that, it uses the global LANGUAGE_CODE setting.

  I haven't tried, but it seems that the LANGUAGE_CODE is the last setting
that Django will use to determine what language the site will appear

  Say me if it helps you. Please.

  Renne Rocha
  renne.ro...@gmail.com
  http://www.linkedin.com/in/rennerocha
  +55 19 8154-9345


On Tue, Aug 10, 2010 at 3:11 PM, kostia  wrote:

> I have a web site. It is www.projector.net.ua. Sometimes it is down.
> I have the latest code here http://github.com/vaxXxa/projector of it.
> I have installed rosetta module to translate the English version of my
> site into Russian and Ukrainian. I did this. You may see it in
> projector/locale folder.
> I setup my settings.py to use 'ru' language just for test.
>
> You can see my base.html file which is getting LANGUAGE_CODE var
> always as 'en', however in settings.py i did specify the 'ru' one.
>
> I have read docs and djangobook (the same as docs, but more
> comfortable as it is displayed on one single page) for several times
> and I can't understand why my site is still in English.
>
> I guess some guru can look at the code above and find an error. If I
> will be so lucky)
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Michael
On Tue, Aug 10, 2010 at 2:49 PM, Colleen A Josephson wrote:

> I just set up a site that uses nginx to server static media and
> Apache/mod_wsgi to deal with the Django stuff.
>
> How would I go about dealing with SSL? Would the setup be on the nginx end
> or the Apache end? Could I still use SSLRedirect middleware?
>
> Thanks,
> -Colleen
>
>
There isn't really much of a need for SSLRedirect Middleware with WSGi any
more. This setup is really a nice one IMO. Thanks to Lincoln Loop for
 putting it up:
http://lincolnloop.com/django-best-practices/deployment/servers.html

Hope that helps,
Michael

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
I just set up a site that uses nginx to server static media and Apache/mod_wsgi 
to deal with the Django stuff.

How would I go about dealing with SSL? Would the setup be on the nginx end or 
the Apache end? Could I still use SSLRedirect middleware?

Thanks,
-Colleen

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
I just set up a site that uses nginx to server static media and Apache/mod_wsgi 
to deal with the Django stuff.

How would I go about dealing with SSL? Would the setup be on the nginx end or 
the Apache end? Could I still use SSLRedirect middleware?

Thanks,
-Colleen

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
I have a web site. It is www.projector.net.ua. Sometimes it is down.
I have the latest code here http://github.com/vaxXxa/projector of it.
I have installed rosetta module to translate the English version of my
site into Russian and Ukrainian. I did this. You may see it in
projector/locale folder.
I setup my settings.py to use 'ru' language just for test.

You can see my base.html file which is getting LANGUAGE_CODE var
always as 'en', however in settings.py i did specify the 'ru' one.

I have read docs and djangobook (the same as docs, but more
comfortable as it is displayed on one single page) for several times
and I can't understand why my site is still in English.

I guess some guru can look at the code above and find an error. If I
will be so lucky)

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



'unicode' object has no attribute '_committed'

2010-08-10 Thread grimmus
Hi,

I am using Django 1.2.1

I have a model called Project that contains a char field and an image
field.

My project used Modeltranslation so i can have an English and French
version of the 2 fields.

When i try and add a project  in the admin i get the error: 'unicode'
object has no attribute '_committed' . I'm quite certain it's an issue
with the image field.

Does anyone know what might be going wrong ?

Thanks

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread ankit rai
Can you describe your problem as i have recently done the django
Internationalisation and i was able to do so .

On Tue, Aug 10, 2010 at 11:05 PM, cootetom  wrote:

> I can't see anything wrong. Maybe someone else will. Maybe just create
> a really simple one page web site from scratch and see if you get the
> same issues?
>
>
>
> On Aug 10, 6:27 pm, kostia  wrote:
> > Of couse I included a {% load i18n %} tag and then used {% trans %}
> > tags in each file.
> >
> > Still no solution
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
Disappointed.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread cootetom
I can't see anything wrong. Maybe someone else will. Maybe just create
a really simple one page web site from scratch and see if you get the
same issues?



On Aug 10, 6:27 pm, kostia  wrote:
> Of couse I included a {% load i18n %} tag and then used {% trans %}
> tags in each file.
>
> Still no solution

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
Of couse I included a {% load i18n %} tag and then used {% trans %}
tags in each file.

Still no solution

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with cache.

2010-08-10 Thread Aljoša Mohorović
On Tue, Aug 10, 2010 at 7:17 PM, Felipe  wrote:
> So,
>
> I'm using a filesystem caching and I'm using cache.get and cache.set
> to set and get the cache.
>
> But sometimes django shows a different value of the stored value in
> the database.

cache is not updated automatically, if value in database has changed
you need to update cache.
where are you caching (cache.set) this value, in a view or after
Model.save() is called?
post part of code where you are using cache.get/set.

Aljosa

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
I did everything. The latest my code is here http://github.com/vaxXxa/projector

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread cootetom
Have you set USE_I18N = True in your settings.py file?



On Aug 10, 6:13 pm, kostia  wrote:
> My base.html has a header:
>
> {% load i18n %}
>
> {% get_current_language as LANGUAGE_CODE %}
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
>
> http://www.w3.org/1999/xhtml; lang="{{ LANGUAGE_CODE }}"
> xml:lang="{{ LANGUAGE_CODE }}">
>
> 
>
>         
>
>         
>
>         ...
> 
>
> The LANGUAGE_CODE in settings is:
>
> LANGUAGE_CODE = 'ru'
>
> #multilingual
>
> LANGUAGES = (
>
>     ('en', 'English'),
>
>     ('ru', 'Russian'),
>
>     ('uk', 'Ukrainian'),
>
> )
>
> Why after reloading the web server and browser (before cleaning from
> history and cookies) I see the English web site and not a Russian one?
>
> I have already created language files and translated with rosetta.
>
> Why I'm so idiot?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with cache.

2010-08-10 Thread Felipe
So,

I'm using a filesystem caching and I'm using cache.get and cache.set
to set and get the cache.

But sometimes django shows a different value of the stored value in
the database.

Ex: the system show a variable in a template: 487.000 entries. And
sometimes, due cache problems, when I update the navigator page, the
variable shows 287.000 entries. If I erase the cache and reload the
page, the value is corrected to 487.000 again.

And there is no mechanism to change the field whose the variable is
associated in the database. I mean: there is nothing changing the
field in the database.

Thanks.

On 10 ago, 14:00, Aljoša Mohorović  wrote:
> On Tue, Aug 10, 2010 at 6:55 PM, Felipe  wrote:
> > So, when I erase the cache, the value is corrected, and the variable
> > turns showing the real value which is stored in the database.
>
> what do you mean when you say cache? browser cache, memcached or something 
> else?
>
> > Could this to be a problem with the memcached ?
>
> are you using memcached? if you're using memcached
> (http://docs.djangoproject.com/en/1.2/topics/cache/#topics-cache) are
> you using low-level API or per-site/per-view cache API?
>
> Aljosa Mohorovic

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread Alexander Jeliuc
you should include {% load i18n %} tag in every file you use translation


On Tue, Aug 10, 2010 at 8:13 PM, kostia  wrote:

> My base.html has a header:
>
> {% load i18n %}
>
> {% get_current_language as LANGUAGE_CODE %}
>
>
>
>  www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> http://www.w3.org/1999/xhtml; lang="{{ LANGUAGE_CODE }}"
> xml:lang="{{ LANGUAGE_CODE }}">
>
> 
>
> />
>
>
>
>...
> 
>
>
> The LANGUAGE_CODE in settings is:
>
> LANGUAGE_CODE = 'ru'
>
>
>
> #multilingual
>
> LANGUAGES = (
>
>('en', 'English'),
>
>('ru', 'Russian'),
>
>('uk', 'Ukrainian'),
>
> )
>
>
>
> Why after reloading the web server and browser (before cleaning from
> history and cookies) I see the English web site and not a Russian one?
>
> I have already created language files and translated with rosetta.
>
> Why I'm so idiot?
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
My base.html has a header:

{% load i18n %}

{% get_current_language as LANGUAGE_CODE %}





http://www.w3.org/1999/xhtml; lang="{{ LANGUAGE_CODE }}"
xml:lang="{{ LANGUAGE_CODE }}">







...



The LANGUAGE_CODE in settings is:

LANGUAGE_CODE = 'ru'



#multilingual

LANGUAGES = (

('en', 'English'),

('ru', 'Russian'),

('uk', 'Ukrainian'),

)



Why after reloading the web server and browser (before cleaning from
history and cookies) I see the English web site and not a Russian one?

I have already created language files and translated with rosetta.

Why I'm so idiot?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
>From djangobook: "If all you want to do is run Django with your native
language, and a language file is available for your language, all you
need to do is set LANGUAGE_CODE."

This is not true! Unfortunately(

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with cache.

2010-08-10 Thread Aljoša Mohorović
On Tue, Aug 10, 2010 at 6:55 PM, Felipe  wrote:
> So, when I erase the cache, the value is corrected, and the variable
> turns showing the real value which is stored in the database.

what do you mean when you say cache? browser cache, memcached or something else?

> Could this to be a problem with the memcached ?

are you using memcached? if you're using memcached
(http://docs.djangoproject.com/en/1.2/topics/cache/#topics-cache) are
you using low-level API or per-site/per-view cache API?

Aljosa Mohorovic

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Problem with cache.

2010-08-10 Thread Felipe
Dear Friends,

I'm using django in a project and I'm having a scary/strange problem.

So, the problem is regarding the cache. I have some variables which
are extracted from the database, with an exact value.

However, some times this variable is extracted from the data base and
show a different value for the visitant, the value is different of the
real value which is stored in the database.

So, when I erase the cache, the value is corrected, and the variable
turns showing the real value which is stored in the database.

Some time after, the problem returns, then I have to delete the cache
again to django show the correct value.

Can somebody help-me with this issue ?

Could this to be a problem with the memcached ?

Thanks in advanced.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Custom CheckboxSelectMultiple Widget that holds state

2010-08-10 Thread wayne
Well, IMO any way that works and you feel comfortable supporting is
"okay".  I can tell you what I did, but I don't know if it's any
better.

If I understand you correctly, you want to bring up the options a user
made previously and start from there instead of a blank slate.  What I
did to accomplish this was to make an ajax call to the server, and
look up whatever identifiable information I had (user, form, etc.).
If it was in the database, I returned a form built from the previous
instance.  If not, I returned a blank form.  It brings in some
javascript (which is obviously not a part of Django, but is a common
component of web apps), but it made things quite a bit more
straightforward, IMO.

You can differentiate between the different options/fields (if
necessary) by using some guaranteed unique identifier and building
your form by hand, which you already appear to be doing.

HTH,

Wayne

On Aug 10, 11:07 am, vcarney  wrote:
> I've got a form with a multi checkbox that contains static choices.
> Using the forms.MultipleChoiceField with the CheckboxSelectMultiple
> widget worked fine for display. However, when displaying an edit form,
> the checkboxes did not hold state (all items were unchecked). To
> handle this I created a custom widget based on CheckboxSelectMultiple
> with the following:
>
> class CustomCheckboxSelectMultiple(SelectMultiple):
>     def render(self, name, value, attrs=None, choices=()):
>         if value is None: value = []
>         has_id = attrs and 'id' in attrs
>         final_attrs = self.build_attrs(attrs, name=name)
>         output = [u'']
>         # Normalize to strings
>         if (isinstance(value, basestring)):
>             value = value.replace('{','')
>             value = value.replace('}','')
>             value = value.replace('"','')
>             value = value.split(',')
>         str_values = set([force_unicode(v) for v in value])
>         for i, (option_value, option_label) in
> enumerate(chain(self.choices, choices)):
>             # If an ID attribute was given, add a numeric index as a
> suffix,
>             # so that the checkboxes don't all have the same ID
> attribute.
>             if has_id:
>                 final_attrs = dict(final_attrs, id='%s_%s' %
> (attrs['id'], i))
>                 label_for = u' for="%s"' % final_attrs['id']
>             else:
>                 label_for = ''
>
>             cb = CheckboxInput(final_attrs, check_test=lambda value:
> value in str_values)
>             option_value = force_unicode(option_value)
>             rendered_cb = cb.render(name, option_value)
>             option_label =
> conditional_escape(force_unicode(option_label))
>             output.append(u'%s %s' %
> (label_for, rendered_cb, option_label))
>         output.append(u'')
>         return mark_safe(u'\n'.join(output))
>
>     def id_for_label(self, id_):
>         # See the comment for RadioSelect.id_for_label()
>         if id_:
>             id_ += '_0'
>         return id_
>     id_for_label = classmethod(id_for_label)
>
> --
> My customizations are:
>
> if (isinstance(value, basestring)):
>             value = value.replace('{','')
>             value = value.replace('}','')
>             value = value.replace('"','')
>             value = value.split(',')
>
> --
> Is there a better way to do this in django?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
Docs and djangobook useless in question of translation. Any other
guide to read is available?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: New server set up

2010-08-10 Thread shacker
There are some lengthy discussions and lots of links on setting up
Django with WHM/cPanel here:

http://forums.cpanel.net/f5/django-python-cpanel-71229-p2.html

And this thread:

http://forums.cpanel.net/f145/django-support-146541.html

is the "official" Django-on-cPanel feature request -- weigh in to let
cPanel (the company) know that you're interested in seeing it built in
to the systen as a hosting option (as they've done with Rails).

For now, you're probably going to want to install a more recent
version of Python in an alternate location on the server, compile
mod_wsgi against it, and do all the setup manually.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Custom CheckboxSelectMultiple Widget that holds state

2010-08-10 Thread vcarney
I've got a form with a multi checkbox that contains static choices.
Using the forms.MultipleChoiceField with the CheckboxSelectMultiple
widget worked fine for display. However, when displaying an edit form,
the checkboxes did not hold state (all items were unchecked). To
handle this I created a custom widget based on CheckboxSelectMultiple
with the following:

class CustomCheckboxSelectMultiple(SelectMultiple):
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name)
output = [u'']
# Normalize to strings
if (isinstance(value, basestring)):
value = value.replace('{','')
value = value.replace('}','')
value = value.replace('"','')
value = value.split(',')
str_values = set([force_unicode(v) for v in value])
for i, (option_value, option_label) in
enumerate(chain(self.choices, choices)):
# If an ID attribute was given, add a numeric index as a
suffix,
# so that the checkboxes don't all have the same ID
attribute.
if has_id:
final_attrs = dict(final_attrs, id='%s_%s' %
(attrs['id'], i))
label_for = u' for="%s"' % final_attrs['id']
else:
label_for = ''

cb = CheckboxInput(final_attrs, check_test=lambda value:
value in str_values)
option_value = force_unicode(option_value)
rendered_cb = cb.render(name, option_value)
option_label =
conditional_escape(force_unicode(option_label))
output.append(u'%s %s' %
(label_for, rendered_cb, option_label))
output.append(u'')
return mark_safe(u'\n'.join(output))

def id_for_label(self, id_):
# See the comment for RadioSelect.id_for_label()
if id_:
id_ += '_0'
return id_
id_for_label = classmethod(id_for_label)

--
My customizations are:

if (isinstance(value, basestring)):
value = value.replace('{','')
value = value.replace('}','')
value = value.replace('"','')
value = value.split(',')

--
Is there a better way to do this in django?



-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MultiPartParserError HTTP_CONTENT_LENGTH zero when uploading a file

2010-08-10 Thread Roger
I'm seeing the same symptoms.  The rate is much lower than 1 in 5 -
maybe 1 in 100 - but definitely the same error.  Were you guys able to
make any progress on a solution?

On Aug 4, 1:17 am, hcarvalhoalves  wrote:
> Now that someone else mentioned, yes, I believe we have the same
> problem.
>
> I run Django thru FastCGI to a Cherokee Web Server, and occasionally,
> uploads fail to continue (the traceback shows that the code hanged at
> consuming the input stream, then the connection got reset by the
> client's browser, raising EOFError).
>
> At first, I filled a bug against Cherokee, but it didn't turned out
> that we were able to narrow the issue. Now I know it's not related to
> the web server, as you run Lighttpd.
>
> The only things I can think of are, a bug on FastCGI (Flup), Django,
> or a bug only triggered when you run Django thru FastCGI.
>
> I've also ran my Django install with SCGI, and with different options
> (fork / threaded), but the intermittent error persists. SCGI still
> uses Flup though.
>
> This bug proved to be really, really hard to reproduce or track down.
> I only get it because I run a SaaS with dozens users uploading photos
> every day, and some requests happen to fail starting the upload and
> end 500'ing.
>
> What about filling a ticket against Django?
>
> On 2 ago, 18:49, Eric Chamberlain  wrote:
>
> > We have an intermittent problem when uploading files.  About one in five 
> > uploads fails, when the MultiPartParser receives an HTTP_CONTENT_LENGTH of 
> > zero.
>
> > We are running Django with lighttpd and fastcgi, has anyone else 
> > encountered this problem?
>
> > --
> > Eric Chamberlain

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Python question about subprocess.Popen() and stdout

2010-08-10 Thread J. Cliff Dyer
On Fri, 2010-08-06 at 18:35 -0100, Joshua Russo wrote:

> 
> 
> Nope, still no dice. Below is what I did. I modified the worker()
> function from one of the Stackoverflow examples. Let me know if I'm
> using flush properly. Keep in mind that everything you see here is
> already running in a separate thread from the wxPython GUI so I can
> update the GUI while all my tests run in the background.
> 

Sorry.  I didn't realize you're doing this in a threaded/wxPython
context.  I really don't have any experience with that kind of
programming.  I was confused, because you posted to a django mailing
list.  You might want to try another list that deals with wxPython
directly.

Cheers,
Cliff



-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Xavier Ordoquy
It is a bit trickier.
Pinax application gets all their dependancies through pip installation and 
requirement files.
If you have a pinax application, take a look in the requirements directory. 
You'll find two files (base.txt and project.txt) that tell exactly what 
application to get and what versions are needed.
Pinax does all the bootstrap processing, so once you installed a pinax 
application, you already have a working environment.

Your application is based on the same common set with Pinax application. 
However, if you copied the code, you didn't went thought pinax bootstraping 
operations which would have installed all the required applications with the 
correct versions.
It happens that I am unable to make your application work on osx and Linux with 
the latest stable django-timezones (0.1.x).
However, using the version that Pinax requires (0.2.dev1) it works on both 
linux and osx.
However, you may find other differences if your environments are different.
Please google for virtualenv and pip to get the same environment on your 
various development boxes as well as your production ones and enjoy virtualenv, 
pip, Python, Django, OSX and Linux :)

Regards,
Xavier.

Le 10 août 2010 à 17:12, Daniel França a écrit :

> I bet you installed pinax on your linux box but not on your osx one (or not 
> in the same virtual env).
> hmmm, I just copied the code from Linux to OSX, is it what you mean? I should 
> have "install" Pinax, that's it?
> 
> On Tue, Aug 10, 2010 at 12:05 PM, Xavier Ordoquy  wrote:
> 
> Actually, it doesn't work on Linux either with the same settings.
> Please update django-timezones to 0.2.dev2 which is what pinax uses (pip 
> install --extra-index-url=http://dist.pinaxproject.com/dev/ 
> django-timezones==0.2.dev1). The latest stable doesn't seem to work with 
> django 1.2.
> I bet you installed pinax on your linux box but not on your osx one (or not 
> in the same virtual env).
> 
> Regards,
> Xavier.
> 
> Le 10 août 2010 à 15:42, Daniel França a écrit :
> 
>> I'm not blaming OSX.
>> I just said that it was working on Linux, and now it's not working on Mac.
>> and even if my code is wrong that shouldn't be that dificulty to find the 
>> error, doesn't agree? A more clear error message would help.
>> The problem isn't the error, but we are about a month arguing about this 
>> error, and I'm sure the error message isn't clear enough.
>> Maybe it's a silly mistake, but I think I should receive a message that 
>> clearly say me that.
>> 
>> 
>> On Tue, Aug 10, 2010 at 10:35 AM, Xavier Ordoquy  
>> wrote:
>> 
>> Le 10 août 2010 à 15:10, Daniel França a écrit :
>> 
>>> It's very useful Andy, sympathy is welcome =)
>>> I was programming under linux, and I guessed that would be really straight 
>>> forward port my project to OSX, I was wrong :(
>> 
>> You know you are unfair. Unless you have strong evidence, you shouldn't 
>> blame osx for mistakes you probably made.
>> Actually, your code doesn't work at all.
>> I just gave a try on ubuntu 9.10/Django 1.2/sqlite DB and got the same error 
>> as I have on OSX (Error binding parameter 1 - probably unsupported type.).
>> 
>> Regards,
>> Xavier.
>> 
>> -- 
>> 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 options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>> 
>> 
>> -- 
>> 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 options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
> 
> 
> -- 
> 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 options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> -- 
> 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 options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this 

Re: Django on Mac OS X

2010-08-10 Thread Daniel França
*I bet you installed pinax on your linux box but not on your osx one (or not
in the same virtual env).*
*hmmm, I just copied the code from Linux to OSX, is it what you mean? I
should have "install" Pinax, that's it?*

On Tue, Aug 10, 2010 at 12:05 PM, Xavier Ordoquy wrote:

>
> Actually, it doesn't work on Linux either with the same settings.
> Please update django-timezones to 0.2.dev2 which is what pinax uses (pip
> install 
> --extra-index-url=http://dist.pinaxproject.com/dev/django-timezones==0.2.dev1).
>  The latest stable doesn't seem to work with
> django 1.2.
> I bet you installed pinax on your linux box but not on your osx one (or not
> in the same virtual env).
>
> Regards,
> Xavier.
>
> Le 10 août 2010 à 15:42, Daniel França a écrit :
>
> I'm not blaming OSX.
> I just said that it was working on Linux, and now it's not working on Mac.
> and even if my code is wrong that shouldn't be that dificulty to find the
> error, doesn't agree? A more clear error message would help.
> The problem isn't the error, but we are about a month arguing about this
> error, and I'm sure the error message isn't clear enough.
> Maybe it's a silly mistake, but I think I should receive a message that
> clearly say me that.
>
>
> On Tue, Aug 10, 2010 at 10:35 AM, Xavier Ordoquy wrote:
>
>>
>> Le 10 août 2010 à 15:10, Daniel França a écrit :
>>
>> It's very useful Andy, sympathy is welcome =)
>> I was programming under linux, and I guessed that would be really straight
>> forward port my project to OSX, I was wrong :(
>>
>>
>> You know you are unfair. Unless you have strong evidence, you shouldn't
>> blame osx for mistakes you probably made.
>> Actually, your code doesn't work at all.
>> I just gave a try on ubuntu 9.10/Django 1.2/sqlite DB and got the same
>> error as I have on OSX (Error binding parameter 1 - probably unsupported
>> type.).
>>
>> Regards,
>> Xavier.
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Xavier Ordoquy

Actually, it doesn't work on Linux either with the same settings.
Please update django-timezones to 0.2.dev2 which is what pinax uses (pip 
install --extra-index-url=http://dist.pinaxproject.com/dev/ 
django-timezones==0.2.dev1). The latest stable doesn't seem to work with django 
1.2.
I bet you installed pinax on your linux box but not on your osx one (or not in 
the same virtual env).

Regards,
Xavier.

Le 10 août 2010 à 15:42, Daniel França a écrit :

> I'm not blaming OSX.
> I just said that it was working on Linux, and now it's not working on Mac.
> and even if my code is wrong that shouldn't be that dificulty to find the 
> error, doesn't agree? A more clear error message would help.
> The problem isn't the error, but we are about a month arguing about this 
> error, and I'm sure the error message isn't clear enough.
> Maybe it's a silly mistake, but I think I should receive a message that 
> clearly say me that.
> 
> 
> On Tue, Aug 10, 2010 at 10:35 AM, Xavier Ordoquy  wrote:
> 
> Le 10 août 2010 à 15:10, Daniel França a écrit :
> 
>> It's very useful Andy, sympathy is welcome =)
>> I was programming under linux, and I guessed that would be really straight 
>> forward port my project to OSX, I was wrong :(
> 
> You know you are unfair. Unless you have strong evidence, you shouldn't blame 
> osx for mistakes you probably made.
> Actually, your code doesn't work at all.
> I just gave a try on ubuntu 9.10/Django 1.2/sqlite DB and got the same error 
> as I have on OSX (Error binding parameter 1 - probably unsupported type.).
> 
> Regards,
> Xavier.
> 
> -- 
> 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 options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> -- 
> 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 options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread kostia
my settings.py:

LANGUAGE_CODE = 'uk'



#multilingual

LANGUAGES = (

('en', 'English'),

('ru', 'Russian'),

('uk', 'Ukrainian'),

)


I've created under myproject/locale folder two translations uk and ru
and translated with rosetta.
I reloaded web server and browser.

Nothing happened. I see English default language still.

On Aug 10, 4:14 pm, cootetom  wrote:
> Have a read about how Django chooses the language to display 
> herehttp://docs.djangoproject.com/en/1.1/topics/i18n/deployment/#how-djan...
>
> Also have a read about how you can change the user's language
> preference on the site 
> herehttp://docs.djangoproject.com/en/1.1/topics/i18n/internationalization...
>
> On Aug 10, 2:01 pm, kostia  wrote:
>
> > I used rosetta to translate strings. How can I switch language of my
> > site and see the result?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Daniel França
I'm not blaming OSX.
I just said that it was working on Linux, and now it's not working on Mac.
and even if my code is wrong that shouldn't be that dificulty to find the
error, doesn't agree? A more clear error message would help.
The problem isn't the error, but we are about a month arguing about this
error, and I'm sure the error message isn't clear enough.
Maybe it's a silly mistake, but I think I should receive a message that
clearly say me that.


On Tue, Aug 10, 2010 at 10:35 AM, Xavier Ordoquy wrote:

>
> Le 10 août 2010 à 15:10, Daniel França a écrit :
>
> It's very useful Andy, sympathy is welcome =)
> I was programming under linux, and I guessed that would be really straight
> forward port my project to OSX, I was wrong :(
>
>
> You know you are unfair. Unless you have strong evidence, you shouldn't
> blame osx for mistakes you probably made.
> Actually, your code doesn't work at all.
> I just gave a try on ubuntu 9.10/Django 1.2/sqlite DB and got the same
> error as I have on OSX (Error binding parameter 1 - probably unsupported
> type.).
>
> Regards,
> Xavier.
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Xavier Ordoquy

Le 10 août 2010 à 15:10, Daniel França a écrit :

> It's very useful Andy, sympathy is welcome =)
> I was programming under linux, and I guessed that would be really straight 
> forward port my project to OSX, I was wrong :(

You know you are unfair. Unless you have strong evidence, you shouldn't blame 
osx for mistakes you probably made.
Actually, your code doesn't work at all.
I just gave a try on ubuntu 9.10/Django 1.2/sqlite DB and got the same error as 
I have on OSX (Error binding parameter 1 - probably unsupported type.).

Regards,
Xavier.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.1.1's Feed only display the latest item

2010-08-10 Thread Daniel Roseman
On Aug 10, 1:35 pm, Federico Maggi  wrote:
> On Tue, Aug 10, 2010 at 13:38, Daniel Roseman  wrote:
> > This was actually an issue with the OP's get_absolute_url method,
> > which has been diagnosed on StackOverflow.
>
>     could you please be more specific (e.g., a URL would be useful).
>
> Thanks!
> -- Fede

http://stackoverflow.com/questions/3446733/django-1-1-1s-feed-only-displays-the-latest-item-while-there-are-many
--
DR.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Translation

2010-08-10 Thread cootetom
Have a read about how Django chooses the language to display here
http://docs.djangoproject.com/en/1.1/topics/i18n/deployment/#how-django-discovers-language-preference

Also have a read about how you can change the user's language
preference on the site here
http://docs.djangoproject.com/en/1.1/topics/i18n/internationalization/#the-set-language-redirect-view




On Aug 10, 2:01 pm, kostia  wrote:
> I used rosetta to translate strings. How can I switch language of my
> site and see the result?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Daniel França
It's very useful Andy, sympathy is welcome =)
I was programming under linux, and I guessed that would be really straight
forward port my project to OSX, I was wrong :(


> 2010/8/10 AndyB 
>
> I haven't got anything useful to add other than some sympathy. I
>> vented my incoherent rage on Twitter a few months ago over how much
>> trouble I had getting various Python binaries working. PIL, MySQL-
>> Python, lxml and a couple more still plague my fevered dreams...
>>
>> As a web developer I never really wanted to get knee-deep in gcc and
>> make errors. I would love someone cleverer than myself to make the
>> experience of getting a fully featured Django install running on OS X
>> a little more streamlined. Unfortunately the people with the skills to
>> do so are usually the people without the need and the people who need
>> one don't have the knowledge to make one. :-(
>>
>> I know it's not fair to moan when you don't contribute but it's nice
>> to share the pain sometimes ;-)
>>
>> (after writing it I decided not to post this to the forum as I'm not
>> saying anything useful but I thought I'd send it to you anyway!)
>>
>> regards,
>>
>> Andy Baker
>
>
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Daniel França
I'll try to update my code.


On Tue, Aug 10, 2010 at 10:06 AM, Xavier Ordoquy wrote:

> Actually I have pinax (trunk) running with the social template and django
> 1.2 without issue using sqlite on OSX.
> I can change my profile timezone in this application without any issue,
> everything seems to be working fine.
>
> Somehow, the changes you made seem to have messed up something or you don't
> use the right pinax/django versions.
>
> Regards,
> Xavier.
>
> Le 10 août 2010 à 14:21, Daniel França a écrit :
>
> the log files are for tests purposes only.
> I'm inserting the site table myself.
>
> is it a bug in pinax profiles? accounts? I didn't get the point.
>
>
> On Tue, Aug 10, 2010 at 9:10 AM, Xavier Ordoquy wrote:
>
>> It is definitively an issue in your code.
>>
>> syncdb won't run without complaining about the timezone field in your
>> account model.
>> Once commented, syncdb continues but at some point will fail because it
>> expects a site to be configured but at this point, the site table is not
>> garanteed to be there...
>>
>> btw, you also have a couple of hard coded path here and there (the log
>> files for example).
>>
>> Regards,
>> Xavier.
>>
>> Le 10 août 2010 à 13:12, Daniel França a écrit :
>>
>> ahh... and my code is in github
>> if someone wanna test it: http://github.com/danielfranca/Tint
>>
>> 2010/8/10 Daniel França 
>>
>>> My code is based on Pinax: http://pinaxproject.com/
>>> and the Profile comes from there.
>>>
>>>
>>> On Tue, Aug 10, 2010 at 5:33 AM, tsmets  wrote:
>>>
 My feeling is that you are now hitting a bug from your app & not a
 django / python / mac / ... issue.
 A stupid gess from me ...
 You use a Custom Profile for the User and it is an upgrade from Django
 1.1 and ... you need to adapt the minor details about it .
 If you code is in a SVN server I can do a svn export and test it here
 if you want ... if I do have the same problem ... it is yr app :(

 \T,



 On Aug 9, 10:40 pm, Daniel França  wrote:
 > Thanx for all the help,
 > I tried to run on Sqlite3, and I don't if it's bad or good news, but
 there's
 > error even in Sqlite3
 >
 > just when I tried to create the db (syncdb) I get just after I input
 my
 > users data or when I try to create a user in shell:
 > Traceback (most recent call last):
 >   File "manage.py", line 31, in 
 > execute_from_command_line()
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 > line 429, in execute_from_command_line
 > utility.execute()
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 > line 379, in execute
 > self.fetch_command(subcommand).run_from_argv(self.argv)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
 > line 191, in run_from_argv
 > self.execute(*args, **options.__dict__)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
 > line 218, in execute
 > output = self.handle(*args, **options)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
 > line 347, in handle
 > return self.handle_noargs(**options)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
 > line 103, in handle_noargs
 > emit_post_sync_signal(created_models, verbosity, interactive, db)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
 > line 185, in emit_post_sync_signal
 > interactive=interactive, db=db)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
 > line 162, in send
 > response = receiver(signal=self, sender=sender, **named)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
 > line 44, in create_superuser
 > call_command("createsuperuser", interactive=True)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 > line 166, in call_command
 > return klass.execute(*args, **defaults)
 >   File
 >
 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
 > 

Re: Django on Mac OS X

2010-08-10 Thread Xavier Ordoquy
Actually I have pinax (trunk) running with the social template and django 1.2 
without issue using sqlite on OSX.
I can change my profile timezone in this application without any issue, 
everything seems to be working fine.

Somehow, the changes you made seem to have messed up something or you don't use 
the right pinax/django versions.

Regards,
Xavier.

Le 10 août 2010 à 14:21, Daniel França a écrit :

> the log files are for tests purposes only.
> I'm inserting the site table myself.
> 
> is it a bug in pinax profiles? accounts? I didn't get the point.
> 
> 
> On Tue, Aug 10, 2010 at 9:10 AM, Xavier Ordoquy  wrote:
> It is definitively an issue in your code.
> 
> syncdb won't run without complaining about the timezone field in your account 
> model.
> Once commented, syncdb continues but at some point will fail because it 
> expects a site to be configured but at this point, the site table is not 
> garanteed to be there...
> 
> btw, you also have a couple of hard coded path here and there (the log files 
> for example).
> 
> Regards,
> Xavier.
> 
> Le 10 août 2010 à 13:12, Daniel França a écrit :
> 
>> ahh... and my code is in github
>> if someone wanna test it: http://github.com/danielfranca/Tint
>> 
>> 2010/8/10 Daniel França 
>> My code is based on Pinax: http://pinaxproject.com/
>> and the Profile comes from there.
>> 
>> 
>> On Tue, Aug 10, 2010 at 5:33 AM, tsmets  wrote:
>> My feeling is that you are now hitting a bug from your app & not a
>> django / python / mac / ... issue.
>> A stupid gess from me ...
>> You use a Custom Profile for the User and it is an upgrade from Django
>> 1.1 and ... you need to adapt the minor details about it .
>> If you code is in a SVN server I can do a svn export and test it here
>> if you want ... if I do have the same problem ... it is yr app :(
>> 
>> \T,
>> 
>> 
>> 
>> On Aug 9, 10:40 pm, Daniel França  wrote:
>> > Thanx for all the help,
>> > I tried to run on Sqlite3, and I don't if it's bad or good news, but 
>> > there's
>> > error even in Sqlite3
>> >
>> > just when I tried to create the db (syncdb) I get just after I input my
>> > users data or when I try to create a user in shell:
>> > Traceback (most recent call last):
>> >   File "manage.py", line 31, in 
>> > execute_from_command_line()
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>> > line 429, in execute_from_command_line
>> > utility.execute()
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>> > line 379, in execute
>> > self.fetch_command(subcommand).run_from_argv(self.argv)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 191, in run_from_argv
>> > self.execute(*args, **options.__dict__)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 218, in execute
>> > output = self.handle(*args, **options)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 347, in handle
>> > return self.handle_noargs(**options)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>> > line 103, in handle_noargs
>> > emit_post_sync_signal(created_models, verbosity, interactive, db)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
>> > line 185, in emit_post_sync_signal
>> > interactive=interactive, db=db)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
>> > line 162, in send
>> > response = receiver(signal=self, sender=sender, **named)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>> > line 44, in create_superuser
>> > call_command("createsuperuser", interactive=True)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>> > line 166, in call_command
>> > return klass.execute(*args, **defaults)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 218, in execute
>> > output = self.handle(*args, **options)
>> >   File
>> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
>> > line 134, in handle
>> > User.objects.create_superuser(username, email, password)
>> >   File

Re: Translation

2010-08-10 Thread kostia
I used rosetta to translate strings. How can I switch language of my
site and see the result?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Turn abstract base class into non-abstract

2010-08-10 Thread Daniel Baron

Hi all,

I am using an abstract base class called "profile" for the extension of 
my user models. I implemented several profiles like "standard, premium, 
staff" and so on.


Now I realised that I would like to check the permission of a certain 
user on a certain project without having to know about his specific 
profile, like this


user.profile.has_permission(project)

but this of course does not work because "profile" is an abstract base 
class, so I can only check "user.premium.has_permission(project)" for 
example. This is pretty bad, because adding profiles would result in a 
change of every piece of code where I check for permissions.


The problem is, that simply removing "abstract = True" does not work, 
because the tables "account_premium" "account_standard" have conflicting 
primary keys.


Is there a way to circumvent this problem?

Thanks in advance,
Daniel

--
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.1.1's Feed only display the latest item

2010-08-10 Thread Federico Maggi
On Tue, Aug 10, 2010 at 13:38, Daniel Roseman  wrote:
> This was actually an issue with the OP's get_absolute_url method,
> which has been diagnosed on StackOverflow.

could you please be more specific (e.g., a URL would be useful).

Thanks!
-- Fede

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Daniel França
the log files are for tests purposes only.
I'm inserting the site table myself.

is it a bug in pinax profiles? accounts? I didn't get the point.


On Tue, Aug 10, 2010 at 9:10 AM, Xavier Ordoquy wrote:

> It is definitively an issue in your code.
>
> syncdb won't run without complaining about the timezone field in your
> account model.
> Once commented, syncdb continues but at some point will fail because it
> expects a site to be configured but at this point, the site table is not
> garanteed to be there...
>
> btw, you also have a couple of hard coded path here and there (the log
> files for example).
>
> Regards,
> Xavier.
>
> Le 10 août 2010 à 13:12, Daniel França a écrit :
>
> ahh... and my code is in github
> if someone wanna test it: http://github.com/danielfranca/Tint
>
> 2010/8/10 Daniel França 
>
>> My code is based on Pinax: http://pinaxproject.com/
>> and the Profile comes from there.
>>
>>
>> On Tue, Aug 10, 2010 at 5:33 AM, tsmets  wrote:
>>
>>> My feeling is that you are now hitting a bug from your app & not a
>>> django / python / mac / ... issue.
>>> A stupid gess from me ...
>>> You use a Custom Profile for the User and it is an upgrade from Django
>>> 1.1 and ... you need to adapt the minor details about it .
>>> If you code is in a SVN server I can do a svn export and test it here
>>> if you want ... if I do have the same problem ... it is yr app :(
>>>
>>> \T,
>>>
>>>
>>>
>>> On Aug 9, 10:40 pm, Daniel França  wrote:
>>> > Thanx for all the help,
>>> > I tried to run on Sqlite3, and I don't if it's bad or good news, but
>>> there's
>>> > error even in Sqlite3
>>> >
>>> > just when I tried to create the db (syncdb) I get just after I input my
>>> > users data or when I try to create a user in shell:
>>> > Traceback (most recent call last):
>>> >   File "manage.py", line 31, in 
>>> > execute_from_command_line()
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> > line 429, in execute_from_command_line
>>> > utility.execute()
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> > line 379, in execute
>>> > self.fetch_command(subcommand).run_from_argv(self.argv)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>>> > line 191, in run_from_argv
>>> > self.execute(*args, **options.__dict__)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>>> > line 218, in execute
>>> > output = self.handle(*args, **options)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>>> > line 347, in handle
>>> > return self.handle_noargs(**options)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>>> > line 103, in handle_noargs
>>> > emit_post_sync_signal(created_models, verbosity, interactive, db)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
>>> > line 185, in emit_post_sync_signal
>>> > interactive=interactive, db=db)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
>>> > line 162, in send
>>> > response = receiver(signal=self, sender=sender, **named)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>>> > line 44, in create_superuser
>>> > call_command("createsuperuser", interactive=True)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> > line 166, in call_command
>>> > return klass.execute(*args, **defaults)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>>> > line 218, in execute
>>> > output = self.handle(*args, **options)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
>>> > line 134, in handle
>>> > User.objects.create_superuser(username, email, password)
>>> >   File
>>> >
>>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
>>> > line 133, in create_superuser
>>> > u = self.create_user(username, email, password)
>>> >   File
>>> >
>>> 

Re: How to handle invalid deleted forms in formsets

2010-08-10 Thread Tomi Pieviläinen

> What version of Django? This sounds a lot like:

Latest (installed by making pip require django>=1.2).

> http://code.djangoproject.com/ticket/11801

It isn't. The problem is not that I'm not getting
formset.deleted_forms, I am. The problem is that these deleted forms
also go to the cleaned_data, which breaks down because the deleted
forms do not validate, thus they don't have form.cleaned_data that the
formset tries to access.

But what can I do with the fs.deleted_forms? If I try to remove them
from the fs.forms before accessing fs.cleaned_data, the access will
break with array out of bounds, as mentioned.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Xavier Ordoquy
It is definitively an issue in your code.

syncdb won't run without complaining about the timezone field in your account 
model.
Once commented, syncdb continues but at some point will fail because it expects 
a site to be configured but at this point, the site table is not garanteed to 
be there...

btw, you also have a couple of hard coded path here and there (the log files 
for example).

Regards,
Xavier.

Le 10 août 2010 à 13:12, Daniel França a écrit :

> ahh... and my code is in github
> if someone wanna test it: http://github.com/danielfranca/Tint
> 
> 2010/8/10 Daniel França 
> My code is based on Pinax: http://pinaxproject.com/
> and the Profile comes from there.
> 
> 
> On Tue, Aug 10, 2010 at 5:33 AM, tsmets  wrote:
> My feeling is that you are now hitting a bug from your app & not a
> django / python / mac / ... issue.
> A stupid gess from me ...
> You use a Custom Profile for the User and it is an upgrade from Django
> 1.1 and ... you need to adapt the minor details about it .
> If you code is in a SVN server I can do a svn export and test it here
> if you want ... if I do have the same problem ... it is yr app :(
> 
> \T,
> 
> 
> 
> On Aug 9, 10:40 pm, Daniel França  wrote:
> > Thanx for all the help,
> > I tried to run on Sqlite3, and I don't if it's bad or good news, but there's
> > error even in Sqlite3
> >
> > just when I tried to create the db (syncdb) I get just after I input my
> > users data or when I try to create a user in shell:
> > Traceback (most recent call last):
> >   File "manage.py", line 31, in 
> > execute_from_command_line()
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> > line 429, in execute_from_command_line
> > utility.execute()
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> > line 379, in execute
> > self.fetch_command(subcommand).run_from_argv(self.argv)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 191, in run_from_argv
> > self.execute(*args, **options.__dict__)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 218, in execute
> > output = self.handle(*args, **options)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 347, in handle
> > return self.handle_noargs(**options)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> > line 103, in handle_noargs
> > emit_post_sync_signal(created_models, verbosity, interactive, db)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
> > line 185, in emit_post_sync_signal
> > interactive=interactive, db=db)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> > line 162, in send
> > response = receiver(signal=self, sender=sender, **named)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> > line 44, in create_superuser
> > call_command("createsuperuser", interactive=True)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> > line 166, in call_command
> > return klass.execute(*args, **defaults)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 218, in execute
> > output = self.handle(*args, **options)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
> > line 134, in handle
> > User.objects.create_superuser(username, email, password)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
> > line 133, in create_superuser
> > u = self.create_user(username, email, password)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
> > line 129, in create_user
> > user.save(using=self._db)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
> > line 435, in save
> > self.save_base(using=using, force_insert=force_insert,
> > force_update=force_update)
> >   File
> > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
> > line 543, 

Re: How to handle invalid deleted forms in formsets

2010-08-10 Thread Karen Tracey
On Mon, Aug 9, 2010 at 8:23 AM, Tomi Pieviläinen  wrote:

> (Using formset_factory, if that makes a difference)
>
> If the user fills a form in formset incompletely and then marks it for
> deletion, my form handling dies horribly. The deleted forms prevent
> formset.cleaned_data from working as they don't validate and thus the
> form doesn't have a cleaned_data attribute. If I try to iterate over
> formset.deleted_forms and delete the forms from formset.forms, then
> formset.cleaned_data crashes due to index out of range.
>
> How should I be handling these invalid forms the user didn't want
> anyway?
>


What version of Django? This sounds a lot like:

http://code.djangoproject.com/ticket/11801

which should be fixed in latest 1.1.X and 1.2.X.

Karen
-- 
http://tracey.org/kmt/

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: one inconsistent place between django document and source code.

2010-08-10 Thread Karen Tracey
On Mon, Aug 9, 2010 at 1:49 AM, yangmin...@gmail.com
wrote:

> Hi All,
>When I was reading django document, I also viewed the source code
> of the framework to help me understand,
>but I found one inconsistent place about urls attribute of
> Django's AdminSite object.
>
># in djangoproject document,
> http://docs.djangoproject.com/en/dev/topics/http/urls/:
> ** This will include the nominated URL patterns into the given
> application and instance namespace. For example, the urls attribute of
> Django's AdminSite object returns a 3-tuple that contains all the
> patterns in an admin site, plus the name of the admin instance, and
> the application namespace admin.
># in source code:  /django/contrib/admin/options.py
>
[code snipped]

Note options.py is defining the urls method for a ModelAdmin object.

The urls method for an AdminSite is in sites.py:

http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/contrib/admin/sites.py#L242

Karen
-- 
http://tracey.org/kmt/

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ManyToManyField limiting choices

2010-08-10 Thread Scott Gould
Define a custom ModelForm for your model that sets the appropriate
queryset parameter (either altering the field in __init__, or just
defining the field in the class as a ModelMultipleChoiceField). Then
register that ModelForm for use in the admin (via a ModelAdmin class).

On Aug 9, 7:51 pm, Martin Tiršel  wrote:
> Hello,
>
> I have a gallery model and an image model. First, I create some galleries,  
> then I insert images into them. But now, I want to add multiple thumbnails  
> feature for galleries (thumbnails representing the gallery, not thumbnails  
> for images inside gallery), so I added ManyToManyField and I can select  
> some images, which will be used as thumbnails. But is there a way, how can  
> I limit these images only to images belonging to the currently editing  
> gallery?
>
> There is the limit_choices_to option, but I would need to point to 'self',  
> what is not possible on this place. Second problem would be that I have to  
> create gallery first, then insert images and then select thumbnails, so  
> there is another problem, that if there would be a solution in limiting  
> the image list, I can not use it in create gallery page in admin.
>
> What is the best way to solve this problem?
>
> Thanks,
> Martin

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: include(admin.site.urls)

2010-08-10 Thread Karen Tracey
On Sun, Aug 8, 2010 at 10:14 PM, Michael P. Soulier <
msoul...@digitaltorque.ca> wrote:

> Hi,
>
> I saw the deprecation warning on using admin.site.root in my urlconf for
> the
> admin site, so I moved to include(admin.site.urls) instead. Unfortunately
> after I logged-in, every click in the admin site took me nowhere (reloaded
> the
> same page).
>
> Any idea of what could cause that? I've moved back to admin.site.root and
> it
> works fine.
>
>
Make sure you have changed the url pattern to exactly what the current docs
say. Taking the old:

('^admin/(.*)', admin.site.root),

and changing just the admin.site.root part so that you have:

('^admin/(.*)', include(admin.site.urls),

does not work properly. You also have to change the first element of the
tuple:

(r'^admin/', include(admin.site.urls)),

Karen
-- 
http://tracey.org/kmt/

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.1.1's Feed only display the latest item

2010-08-10 Thread Daniel Roseman
On Aug 10, 9:04 am, Federico Maggi  wrote:
> On Tue, Aug 10, 2010 at 09:47, Tomi Pieviläinen  wrote:
> > As mentioned in the IRC channel, the feed did indeed display two
> > items, but because it was invalid markup (based on W3) Safari didn't
> > show them properly.
>
>     I noticed, but has this issue (i.e., invalid RSS markup) been
> fixed in 1.2 or at least after 1.1.1?
>
> -- Fede

This was actually an issue with the OP's get_absolute_url method,
which has been diagnosed on StackOverflow.
--
DR.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread Daniel França
ahh... and my code is in github
if someone wanna test it: http://github.com/danielfranca/Tint

2010/8/10 Daniel França 

> My code is based on Pinax: http://pinaxproject.com/
> and the Profile comes from there.
>
>
> On Tue, Aug 10, 2010 at 5:33 AM, tsmets  wrote:
>
>> My feeling is that you are now hitting a bug from your app & not a
>> django / python / mac / ... issue.
>> A stupid gess from me ...
>> You use a Custom Profile for the User and it is an upgrade from Django
>> 1.1 and ... you need to adapt the minor details about it .
>> If you code is in a SVN server I can do a svn export and test it here
>> if you want ... if I do have the same problem ... it is yr app :(
>>
>> \T,
>>
>>
>>
>> On Aug 9, 10:40 pm, Daniel França  wrote:
>> > Thanx for all the help,
>> > I tried to run on Sqlite3, and I don't if it's bad or good news, but
>> there's
>> > error even in Sqlite3
>> >
>> > just when I tried to create the db (syncdb) I get just after I input my
>> > users data or when I try to create a user in shell:
>> > Traceback (most recent call last):
>> >   File "manage.py", line 31, in 
>> > execute_from_command_line()
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>> > line 429, in execute_from_command_line
>> > utility.execute()
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>> > line 379, in execute
>> > self.fetch_command(subcommand).run_from_argv(self.argv)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 191, in run_from_argv
>> > self.execute(*args, **options.__dict__)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 218, in execute
>> > output = self.handle(*args, **options)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 347, in handle
>> > return self.handle_noargs(**options)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>> > line 103, in handle_noargs
>> > emit_post_sync_signal(created_models, verbosity, interactive, db)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
>> > line 185, in emit_post_sync_signal
>> > interactive=interactive, db=db)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
>> > line 162, in send
>> > response = receiver(signal=self, sender=sender, **named)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>> > line 44, in create_superuser
>> > call_command("createsuperuser", interactive=True)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>> > line 166, in call_command
>> > return klass.execute(*args, **defaults)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
>> > line 218, in execute
>> > output = self.handle(*args, **options)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
>> > line 134, in handle
>> > User.objects.create_superuser(username, email, password)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
>> > line 133, in create_superuser
>> > u = self.create_user(username, email, password)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
>> > line 129, in create_user
>> > user.save(using=self._db)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
>> > line 435, in save
>> > self.save_base(using=using, force_insert=force_insert,
>> > force_update=force_update)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
>> > line 543, in save_base
>> > created=(not record_exists), raw=raw)
>> >   File
>> >
>> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
>> > line 162, in send
>> > response = receiver(signal=self, sender=sender, **named)
>> >   File
>> > 

Re: Django on Mac OS X

2010-08-10 Thread Daniel França
My code is based on Pinax: http://pinaxproject.com/
and the Profile comes from there.

On Tue, Aug 10, 2010 at 5:33 AM, tsmets  wrote:

> My feeling is that you are now hitting a bug from your app & not a
> django / python / mac / ... issue.
> A stupid gess from me ...
> You use a Custom Profile for the User and it is an upgrade from Django
> 1.1 and ... you need to adapt the minor details about it .
> If you code is in a SVN server I can do a svn export and test it here
> if you want ... if I do have the same problem ... it is yr app :(
>
> \T,
>
>
>
> On Aug 9, 10:40 pm, Daniel França  wrote:
> > Thanx for all the help,
> > I tried to run on Sqlite3, and I don't if it's bad or good news, but
> there's
> > error even in Sqlite3
> >
> > just when I tried to create the db (syncdb) I get just after I input my
> > users data or when I try to create a user in shell:
> > Traceback (most recent call last):
> >   File "manage.py", line 31, in 
> > execute_from_command_line()
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> > line 429, in execute_from_command_line
> > utility.execute()
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> > line 379, in execute
> > self.fetch_command(subcommand).run_from_argv(self.argv)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 191, in run_from_argv
> > self.execute(*args, **options.__dict__)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 218, in execute
> > output = self.handle(*args, **options)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 347, in handle
> > return self.handle_noargs(**options)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> > line 103, in handle_noargs
> > emit_post_sync_signal(created_models, verbosity, interactive, db)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
> > line 185, in emit_post_sync_signal
> > interactive=interactive, db=db)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> > line 162, in send
> > response = receiver(signal=self, sender=sender, **named)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> > line 44, in create_superuser
> > call_command("createsuperuser", interactive=True)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> > line 166, in call_command
> > return klass.execute(*args, **defaults)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> > line 218, in execute
> > output = self.handle(*args, **options)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
> > line 134, in handle
> > User.objects.create_superuser(username, email, password)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
> > line 133, in create_superuser
> > u = self.create_user(username, email, password)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
> > line 129, in create_user
> > user.save(using=self._db)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
> > line 435, in save
> > self.save_base(using=using, force_insert=force_insert,
> > force_update=force_update)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
> > line 543, in save_base
> > created=(not record_exists), raw=raw)
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> > line 162, in send
> > response = receiver(signal=self, sender=sender, **named)
> >   File
> > "/Users/danielfranca/workspace/django/view/tint/apps/account/models.py",
> > line 61, in create_account
> > account, created =
> > Account.objects.get_or_create(user=instance,timezone='America/Sao_Paulo')
> >   File
> >
> 

Re: Django 1.1.1's Feed only display the latest item

2010-08-10 Thread Federico Maggi
On Tue, Aug 10, 2010 at 09:47, Tomi Pieviläinen  wrote:
> As mentioned in the IRC channel, the feed did indeed display two
> items, but because it was invalid markup (based on W3) Safari didn't
> show them properly.

I noticed, but has this issue (i.e., invalid RSS markup) been
fixed in 1.2 or at least after 1.1.1?

-- Fede

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django on Mac OS X

2010-08-10 Thread tsmets
My feeling is that you are now hitting a bug from your app & not a
django / python / mac / ... issue.
A stupid gess from me ...
You use a Custom Profile for the User and it is an upgrade from Django
1.1 and ... you need to adapt the minor details about it .
If you code is in a SVN server I can do a svn export and test it here
if you want ... if I do have the same problem ... it is yr app :(

\T,



On Aug 9, 10:40 pm, Daniel França  wrote:
> Thanx for all the help,
> I tried to run on Sqlite3, and I don't if it's bad or good news, but there's
> error even in Sqlite3
>
> just when I tried to create the db (syncdb) I get just after I input my
> users data or when I try to create a user in shell:
> Traceback (most recent call last):
>   File "manage.py", line 31, in 
>     execute_from_command_line()
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 429, in execute_from_command_line
>     utility.execute()
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 379, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> line 191, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> line 218, in execute
>     output = self.handle(*args, **options)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> line 347, in handle
>     return self.handle_noargs(**options)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> line 103, in handle_noargs
>     emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py",
> line 185, in emit_post_sync_signal
>     interactive=interactive, db=db)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> line 162, in send
>     response = receiver(signal=self, sender=sender, **named)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 44, in create_superuser
>     call_command("createsuperuser", interactive=True)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 166, in call_command
>     return klass.execute(*args, **defaults)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py",
> line 218, in execute
>     output = self.handle(*args, **options)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
> line 134, in handle
>     User.objects.create_superuser(username, email, password)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
> line 133, in create_superuser
>     u = self.create_user(username, email, password)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py",
> line 129, in create_user
>     user.save(using=self._db)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
> line 435, in save
>     self.save_base(using=using, force_insert=force_insert,
> force_update=force_update)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py",
> line 543, in save_base
>     created=(not record_exists), raw=raw)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> line 162, in send
>     response = receiver(signal=self, sender=sender, **named)
>   File
> "/Users/danielfranca/workspace/django/view/tint/apps/account/models.py",
> line 61, in create_account
>     account, created =
> Account.objects.get_or_create(user=instance,timezone='America/Sao_Paulo')
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/manager.py",
> line 135, in get_or_create
>     return self.get_query_set().get_or_create(**kwargs)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/query.py",
> line 366, in get_or_create
>     return self.get(**kwargs), False
>   File
> 

Re: filtering related object in template

2010-08-10 Thread Daniel Roseman
On Aug 10, 1:34 am, Martin Tiršel  wrote:
> Hello,
>
> I can do:
>
> {% for image in gallery.image_set.all %}
> ...
> {% endfor %}
>
> but my image model has:
> is_thumbnail = models.BooleanField()
>
> and I want to limit displaying only these images which have  
> is_thumbnail=True. I can create a method on the image model, which returns  
> images I want to, but is it possible in template too?
>
> Thanks,
> Martin

No, because that filter call will require an argument, and you can't
call methods with arguments in the template language. As you say,
create a model method (or better, a method on the Manager).
--
DR.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.1.1's Feed only display the latest item

2010-08-10 Thread Tomi Pieviläinen
As mentioned in the IRC channel, the feed did indeed display two
items, but because it was invalid markup (based on W3) Safari didn't
show them properly.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django 1.1.1's Feed only display the latest item

2010-08-10 Thread phretor
Hello,
I've created a Feed subclass to export a simple feed of news
http://paste.pocoo.org/show/248193/. As you can see (L45-46), the Feed
subclass' items() method returns the first 15 objects in
News.objects.order_by('-time'):

def items(self):
return News.objects.order_by('-time')[:15]

Nevertheless, only one item is exported in the feed:
http://www.sshguard.net/litenewz/feeds/news/

Unfortunately, there are two objects of the News model:

>>> from litenewz.models import *
>>> News.objects.all()
[, ]

Any help?

I prefer not to switch to Django 1.2, unless this is strictly
necessary to solve the issue described.

Thanks in advance,
-- Federico

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.