Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.

On Jul 9, 11:25 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 7/9/07, Daniel Kvasnicka jr. ...
>
> > stream = loader.load('index.xml').generate(
> > types = 
> > AdSpaceType.objects.all(),
> ...
> >   UnicodeDecodeError at /
> >   'ascii' codec can't decode byte 0xc5 in position 1: ordinal not in
> > range(128)
> ...
>
> > I simply need Django's ORM to return attributes of models as Unicode
>
> If you're on a recent subversion checkout, it does.

Yes, it does, thanks for your help. Revision 5640 works like a charm.

Cheers,
Dan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: No module named _md5

2007-07-09 Thread e-gor

Rebuilding apache doesn't help

# python
Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import md5
>>> import _md5
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named _md5
>>> import hashlib
>>> import _hashlib


so i have error when importing _md5 and have no erroro when importing
md5. What it mean? :)

On Jul 7, 2:40 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Jul 7, 6:25 pm, e-gor <[EMAIL PROTECTED]> wrote:
>
> > Switching off mod_php doesn't help.
>
> > when i import module md5 from command prompt there are no errors:
>
> > # python
> > Python 2.5.1 (r251:54863, Jun 28 2007, 13:12:40)
> > [GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
> > Type "help", "copyright", "credits" or "license" for more information.>>> 
> > import md5
> > >>> import blahblah
>
> > Traceback (most recent call last):
> >   File "", line 1, in 
> > ImportError: No module named blahblah
>
> Can you import 'hashlib' on the command line:
>
>   import hashlib
>
> In Python 2.5 how the hash library modules is done was changed. This
> has caused issues before:
>
>  http://www.modpython.org/pipermail/mod_python/2007-April/023508.html
>  http://www.modpython.org/pipermail/mod_python/2007-April/023512.html
>
> A suitable answer wasn't found as it fixed itself when person
> recompiled Apache.
>
> My suspicion is that in recompiling Apache, Apache was then using the
> same shared library version of something (probably SSL libraries) as
> one of the Python hash modules was using. Previous to that it was
> using different versions and that caused a problem when loading one of
> the Python modules, thus resulting in it falling back to trying to
> load _md5 when it shouldn't have. Loading _md5 would fail as in Python
> 2.5 it doesn't necessarily exist as hashlib modules replace it from
> memory.
>
> Note, in recompiling Apache it may be important to ensure that it
> finds and uses system SSL libraries, otherwise it will use one from
> its own source code and that is where the clash may arise because
> Python will use the system one instead.
>
> Graham
>
> > On Jul 6, 4:26 pm, Roboto <[EMAIL PROTECTED]> wrote:
>
> > > i'm not great at this, but a shot in the dark - turn off mod_php
>
> > > On Jul 5, 2:59 pm, e-gor <[EMAIL PROTECTED]> wrote:
>
> > > > I have python 2.5.1, django report errors:
>
> > > >Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> > > > Traceback (most recent call last):
>
> > > >   File "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
> > > > line 193, in Dispatch
> > > > result = object(req)
>
> > > >   File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > modpython.py", line 177, in handler
> > > > return ModPythonHandler()(req)
>
> > > >   File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > modpython.py", line 145, in __call__
> > > > self.load_middleware()
>
> > > >   File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> > > > base.py", line 31, in load_middleware
> > > > raise exceptions.ImproperlyConfigured, 'Error importing middleware
> > > > %s: "%s"' % (mw_module, e)
>
> > > > ImproperlyConfigured: Error importing middleware
> > > > django.middleware.common: "No module named _md5"
>
> > > > When i write import md5 from python command prompt i have no errors.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



討論 django-developer-position-in-tampa

2007-07-09 Thread lee
進入參觀-XYZ軟體小站
http://xyz22.com

CQC0103 Sisulizer Enterprise v1.5.12 繁體中文正式版(視化編輯工具翻譯文本)
CQC0102 Compuware DevPartner for Visual C Plus Plus BoundsChecker
Suite v8.2 英文正式版(程

式調試工具)
CQC0101 TestLog v3.0.1008 英文正式版(綜合測試案例的關係系統軟體)
CQC0100 NuSphere PhpED v5.0 英文正式版(編程開發軟體)
CQC0099 Heaventools PE Explorer v1.99 英文正式版(程式資源編輯工具軟體)
CQC0097 DB Solo v2.1.6 英文正式版(數據庫開發軟體)
CQC0096 Atlassian Bamboo v1.1.1 英文正式版(持續集成構建伺服器軟體)
CQC0095 PHP Designer 2007 Professional v5.3.2 英文正式版(編程開發軟體)
CQC0094 JiveSoftware JiveKnowledgeBase v17.5 英文正式版(知識數據庫軟體)
CQC0093 Catalyst SocketWrench Secure Edition v5.0.5015 英文正式版(編程開發軟體)
CQC0092 SimDesign NativeXml v2.32 for Delphi BCB Full Source 英文正式版
(delphi和bcb的XML控

件軟體)
CQC0091 AppSense Management Suite v7.1.101.0 英文正式版(行業相關軟體)
CQC0090 Sisulizer v1.5.5 Enterprise Edition Multilanguage Win2kXP2k3 英文
正式版(程式開發軟

體)
CQC0089 Syncro SVN Client v2.3 英文正式版(sVN源碼管理器用戶端工具軟體)
CQC0088 Amayeta SWC Encrypt v1.0.1 英文正式版(Flash元件開發軟體)
CQC0087 AgentSheets v2.61英文正式版(編程開發軟體)
CQC0086 AgentSheets v2.61 Greek 希臘語破解版(編程開發軟體)
進入參觀-XYZ軟體小站
http://xyz22.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



討論 django-developer-position-in-tampa

2007-07-09 Thread lee
進入參觀-XYZ軟體小站
http://xyz22.com

CQC0103 Sisulizer Enterprise v1.5.12 繁體中文正式版(視化編輯工具翻譯文本)
CQC0102 Compuware DevPartner for Visual C Plus Plus BoundsChecker
Suite v8.2 英文正式版(程

式調試工具)
CQC0101 TestLog v3.0.1008 英文正式版(綜合測試案例的關係系統軟體)
CQC0100 NuSphere PhpED v5.0 英文正式版(編程開發軟體)
CQC0099 Heaventools PE Explorer v1.99 英文正式版(程式資源編輯工具軟體)
CQC0097 DB Solo v2.1.6 英文正式版(數據庫開發軟體)
CQC0096 Atlassian Bamboo v1.1.1 英文正式版(持續集成構建伺服器軟體)
CQC0095 PHP Designer 2007 Professional v5.3.2 英文正式版(編程開發軟體)
CQC0094 JiveSoftware JiveKnowledgeBase v17.5 英文正式版(知識數據庫軟體)
CQC0093 Catalyst SocketWrench Secure Edition v5.0.5015 英文正式版(編程開發軟體)
CQC0092 SimDesign NativeXml v2.32 for Delphi BCB Full Source 英文正式版
(delphi和bcb的XML控

件軟體)
CQC0091 AppSense Management Suite v7.1.101.0 英文正式版(行業相關軟體)
CQC0090 Sisulizer v1.5.5 Enterprise Edition Multilanguage Win2kXP2k3 英文
正式版(程式開發軟

體)
CQC0089 Syncro SVN Client v2.3 英文正式版(sVN源碼管理器用戶端工具軟體)
CQC0088 Amayeta SWC Encrypt v1.0.1 英文正式版(Flash元件開發軟體)
CQC0087 AgentSheets v2.61英文正式版(編程開發軟體)
CQC0086 AgentSheets v2.61 Greek 希臘語破解版(編程開發軟體)
進入參觀-XYZ軟體小站
http://xyz22.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



討論 django-developer-position-in-tampa

2007-07-09 Thread lee
進入參觀-XYZ軟體小站

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



進入參觀-XYZ軟體小站

2007-07-09 Thread lee
進入參觀-XYZ軟體小站
http://xyz22.com

CQC0103 Sisulizer Enterprise v1.5.12 繁體中文正式版(視化編輯工具翻譯文本)
CQC0102 Compuware DevPartner for Visual C Plus Plus BoundsChecker
Suite v8.2 英文正式版(程

式調試工具)
CQC0101 TestLog v3.0.1008 英文正式版(綜合測試案例的關係系統軟體)
CQC0100 NuSphere PhpED v5.0 英文正式版(編程開發軟體)
CQC0099 Heaventools PE Explorer v1.99 英文正式版(程式資源編輯工具軟體)
CQC0097 DB Solo v2.1.6 英文正式版(數據庫開發軟體)
CQC0096 Atlassian Bamboo v1.1.1 英文正式版(持續集成構建伺服器軟體)
CQC0095 PHP Designer 2007 Professional v5.3.2 英文正式版(編程開發軟體)
CQC0094 JiveSoftware JiveKnowledgeBase v17.5 英文正式版(知識數據庫軟體)
CQC0093 Catalyst SocketWrench Secure Edition v5.0.5015 英文正式版(編程開發軟體)
CQC0092 SimDesign NativeXml v2.32 for Delphi BCB Full Source 英文正式版
(delphi和bcb的XML控

件軟體)
CQC0091 AppSense Management Suite v7.1.101.0 英文正式版(行業相關軟體)
CQC0090 Sisulizer v1.5.5 Enterprise Edition Multilanguage Win2kXP2k3 英文
正式版(程式開發軟

體)
CQC0089 Syncro SVN Client v2.3 英文正式版(sVN源碼管理器用戶端工具軟體)
CQC0088 Amayeta SWC Encrypt v1.0.1 英文正式版(Flash元件開發軟體)
CQC0087 AgentSheets v2.61英文正式版(編程開發軟體)
CQC0086 AgentSheets v2.61 Greek 希臘語破解版(編程開發軟體)
進入參觀-XYZ軟體小站
http://xyz22.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Question about AddManipulator/ChangeManipulator

2007-07-09 Thread Jonathan Buchanan

> It would be good if the a Django core developer could confirm its
> removal in 1.0 though. There are quite a lot of methods calling
> AddManipulator for slightly different purposes and rewriting them.

"django.newforms is new in Django's 0.96 release, but, as it won't be 
new forever, we plan to rename it to django.forms in the future. The 
current django.forms package will be available as django.oldforms until 
Django 1.0, when we plan to remove it for good." [1]

Jonathan

[1] http://www.djangoproject.com/documentation/newforms/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Question about AddManipulator/ChangeManipulator

2007-07-09 Thread Nimrod A. Abing

Hi,

Actually this project has already been refactored to use newforms and
as I was reviewing it lately I spotted several methods in my views
where AddManipulator was called. I remember I paid no mind to those
calls since I figured these "magic" methods were part of the model
spec and not part of the oldforms spec.

It would be good if the a Django core developer could confirm its
removal in 1.0 though. There are quite a lot of methods calling
AddManipulator for slightly different purposes and rewriting them.

On another note, has anyone here ever done any security audits (reason
I've been reviewing a lot of my code lately) on core Django code? Can
anyone point me to any resources I can find on the subject?

Thanks again.

On 7/10/07, oggie rob <[EMAIL PROTECTED]> wrote:
>
> Since you haven't got an answer yet...
> I'm not a project developer, so I can't say what their intentions are,
> but having worked extensively using oldforms and recently using
> newforms, I doubt very much that the Manipulator framework will hang
> around for anything other than temporary backward compatibility (and
> therefore my guess is that it would be removed before 1.0). Just as
> importantly, newforms are a vast improvement over the manipulator
> framework and so even for the short term you will probably see payoff
> for your efforts.
> I say "upgradde" for a double dose of formness.
>
>  -rob
>
> On Jul 9, 11:40 am, "Nimrod A. Abing" <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I am currently in the process of porting one of my oldforms-based app
> > to use newforms. I have some blocks of code that use
> > AddManipulator/ChangeManipulator methods. My question is, when
> > oldforms is eventually removed, will AddManipulator/ChangeManipulator
> > get removed too?
> >
> > Thanks in advance.
> > --
> > _nimrod_a_abing_
> >
> > http://abing.gotdns.com/http://www.preownedcar.com/
>
>
> >
>


-- 
_nimrod_a_abing_

http://abing.gotdns.com/
http://www.preownedcar.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms: clean way to customize a widget's label?

2007-07-09 Thread leifbyron

Arthur,

You'll probably find this of interest:

http://groups.google.com/group/django-developers/browse_thread/thread/38dd8e4e11f055e8

Cheers,
Leif


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Question about AddManipulator/ChangeManipulator

2007-07-09 Thread oggie rob

Since you haven't got an answer yet...
I'm not a project developer, so I can't say what their intentions are,
but having worked extensively using oldforms and recently using
newforms, I doubt very much that the Manipulator framework will hang
around for anything other than temporary backward compatibility (and
therefore my guess is that it would be removed before 1.0). Just as
importantly, newforms are a vast improvement over the manipulator
framework and so even for the short term you will probably see payoff
for your efforts.
I say "upgradde" for a double dose of formness.

 -rob

On Jul 9, 11:40 am, "Nimrod A. Abing" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am currently in the process of porting one of my oldforms-based app
> to use newforms. I have some blocks of code that use
> AddManipulator/ChangeManipulator methods. My question is, when
> oldforms is eventually removed, will AddManipulator/ChangeManipulator
> get removed too?
>
> Thanks in advance.
> --
> _nimrod_a_abing_
>
> http://abing.gotdns.com/http://www.preownedcar.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Jeremy Dunck

On 7/9/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
> >>> x[0].name.__class__
> 
>
> I'll probably try SVN, but dunno about my hosting provider...

It looks like you could prepend your python path to force a local
Django to be used:
http://modpython.org/live/current/doc-html/dir-other-pp.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Beginner's question (take two)

2007-07-09 Thread Chris Rich

Cool thanks,
  Yeah I was didn't think there was a meta class for the app names.
I'll go fiddle around with it.

Chris

On Jul 9, 3:23 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > Quick question.  Is there any way to add a verbose name for
> > one of my apps?  I have an app named my_transfers and in the
> > admin index view
>
> Ah...I missed that it was the *app* not the Model that you were
> looking for.
>
> According to django/contrib/admin/templates/admin/index.html
>
> you want to affect the value of {{app_list.name}}  This is
> assigned in the django/contrib/admin/templatetags/adminapplist.py
>
> Tracing this back to db/models/base.py where it's assigned, and
> looking at several other places in the code, this looks like this
> needs to be a name that can be used in identifier contexts.
>
> However, since it's just being pulled into the template, you can
> tweak the django/contrib/admin/templates/admin/index.html and its
> kin to pull a prettified app-name if desired for presentation
> purposes, and fall back to the original code if not specified.
>
> -tim


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: faking request path

2007-07-09 Thread Collin Grady

It sounds like you're barking up the wrong tree ;)  "faking" a request
path on django's side would not alter your template links one iota, so
they'd still be bad :)

On Jul 9, 7:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello all!
>
> Is there an easy way to fake the request path in django and/or pyton?
> I'm looking for something like this:
> a django page which is called with this 
> URL:http://www.test.ch/test1/test2/test3
> should thinks it is run in the top-folder that means:http://www.test.ch
>
> I need that because I have to use somehow already given templates,
> which I cannot edit, and which believe they are always run in the top-
> domain folder.
>
> Thanks in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: loading xml through javascript

2007-07-09 Thread Collin Grady

Unless the object supports post params, that's not possible. You have
to submit the data through the XML request, you can't just hijack it
from the other.

The only other option I can see is if you do something like shoving
everything in request.session and reading that in the other page.

On Jul 9, 3:36 pm, tyman26 <[EMAIL PROTECTED]> wrote:
> I'm using an activex control that loads data with xml via javascript.
> I have no problem using django to build my xml file when I'm testing
> examples with static information.  The problem comes in when I want to
> pass dynamic information to the xml generated view.  For example, here
> is a template called 'results.html' which loads my activex widget:
> .
> 
> 
> 
> 
> mygrid = new dhtmlXGridObject('gridbox');
> ...
> mygrid.loadXML("http://192.168.xx.xx/search/buildXML";);
> 
> .
>
> As you can see I load the xml document through the url called /search/
> buildXML.   The only problem is I want request information from the
> view that opens this template to also be available in the view that
> creates my xml code. I don't want to have to pass it through the
> url because the information is sensitive.  Does anybody know another
> way around 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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Ticket #399 (Bigint field object needed) status

2007-07-09 Thread Peter Nixon

OK. Agreed. By partial, I meant support for "standard" BIGINT and not the 
MySQL specific unsigned extension.

I will have a stab at implementing for Postgresql and sqllite and see how it 
goes.

Cheers

On Tue 10 Jul 2007, Collin Grady wrote:
> Mentioned this on IRC, but just for the record here as well: It's
> likely that the patch wouldn't be applied so long as it affects only
> one backend - fields have to be consistent across all of them (partial
> is /not/ better in cases like that). :)
>
> On Jul 9, 1:47 pm, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > Hi Guys
> >
> > I am a relative newcommer to the Django world (a couple of months), so
> > this is my first post to the list. Let me first say how quickly I fell
> > in love with the power and flexibility of Django. Keep up the good work.
> >
> > I have a question however. While trying to interface with an existing
> > SQL table I stumbled across the problem that Django doesn't currently
> > support BIGINT field types. I managed to track down a ticket in the
> > tracker which has been open for for 2 year which appears to fix this
> > problem:
> >
> > http://code.djangoproject.com/ticket/399
> >
> > Is there any reason why this patch has not been applied in one form or
> > another? Partial/imperfect support  for BIGINT would IMHO be better than
> > nothing..
> >
> > Regards
> > --
> >
> > Peter Nixonhttp://www.peternixon.net/
> > PGP Key:http://www.peternixon.net/public.asc
>
> 


-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Beginner's question (take two)

2007-07-09 Thread Tim Chase

> Quick question.  Is there any way to add a verbose name for
> one of my apps?  I have an app named my_transfers and in the
> admin index view


Ah...I missed that it was the *app* not the Model that you were 
looking for.

According to django/contrib/admin/templates/admin/index.html

you want to affect the value of {{app_list.name}}  This is 
assigned in the django/contrib/admin/templatetags/adminapplist.py

Tracing this back to db/models/base.py where it's assigned, and 
looking at several other places in the code, this looks like this 
needs to be a name that can be used in identifier contexts.

However, since it's just being pulled into the template, you can 
tweak the django/contrib/admin/templates/admin/index.html and its 
kin to pull a prettified app-name if desired for presentation 
purposes, and fall back to the original code if not specified.

-tim






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Urlresolvers issue ... side effect of named URL patterns ?

2007-07-09 Thread xgdlm

Hello all,

I just sync my django with the latest SVN version to try the Unicode
branch. Previously I was running Django 0.96pre.
I have now an issue with reverse url.

Here is for exemple my urls.py

urlpatterns = patterns('',
(r'member/status(?P\d+)/(?P\d+)/$',
'app.views_admin.member_list'),
(r'member/status(?P\d+)/$', 'app.views_admin.member_list'),
(r'member/$', 'app.views_admin.member_list'),
)

I used to retrieve the reverse URL by calling :

reverse('app.views_admin.member_list',urlconf=None,args=[3,2]) and
this was returning /member/status3/2/
reverse('app.views_admin.member_list',urlconf=None,args=[3]) and this
was returning /member/status3/
reverse('app.views_admin.member_list',urlconf=None,args=[]) and this
was returning /member/

It seems not working anymore, I get the error message 'NoReverseMatch:
Not enough positional arguments passed in' .

I used to decalre my URL linked to the same view in number of
arguments descending ... so if one arg was given the first (r'member/
status(?P\d+)/(?P\d+)/$', 'app.views_admin.member_list')
didn't match then the (r'member/status(?P\d+)/$',
'app.views_admin.member_list') mached. If no argument was given the
first two URL pattern didn't match so the last one matched. This is
not the case with the latest SVN version

I guess this is a side effect of the named URL patterns feature 
so do I have to name all my URL now ?

As all my apps and view are build on this, I guess I have quite a lot
of work :)

Thanks in advance,

xav


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Ticket #399 (Bigint field object needed) status

2007-07-09 Thread Collin Grady

Mentioned this on IRC, but just for the record here as well: It's
likely that the patch wouldn't be applied so long as it affects only
one backend - fields have to be consistent across all of them (partial
is /not/ better in cases like that). :)

On Jul 9, 1:47 pm, Peter Nixon <[EMAIL PROTECTED]> wrote:
> Hi Guys
>
> I am a relative newcommer to the Django world (a couple of months), so this
> is my first post to the list. Let me first say how quickly I fell in love
> with the power and flexibility of Django. Keep up the good work.
>
> I have a question however. While trying to interface with an existing SQL
> table I stumbled across the problem that Django doesn't currently support
> BIGINT field types. I managed to track down a ticket in the tracker which
> has been open for for 2 year which appears to fix this problem:
>
> http://code.djangoproject.com/ticket/399
>
> Is there any reason why this patch has not been applied in one form or
> another? Partial/imperfect support  for BIGINT would IMHO be better than
> nothing..
>
> Regards
> --
>
> Peter Nixonhttp://www.peternixon.net/
> PGP Key:http://www.peternixon.net/public.asc


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Beginner's question

2007-07-09 Thread Tim Chase

> Quick question.  Is there any way to add a verbose name for
> one of my apps?  I have an app named my_transfers and in the

http://www.djangoproject.com/documentation/model-api/#verbose-name

Use the verbose_name of the Meta class:

class MyModel(Model):
...
class Meta:
   verbose_name = 'My glorious model of perfection'
   verbose_plural_name = 'My glorious models of perfection"



-tim



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.

On Jul 9, 11:25 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 7/9/07, Daniel Kvasnicka jr. ...
>
> > stream = loader.load('index.xml').generate(
> > types = 
> > AdSpaceType.objects.all(),
> ...
> >   UnicodeDecodeError at /
> >   'ascii' codec can't decode byte 0xc5 in position 1: ordinal not in
> > range(128)
> ...
>
> > I simply need Django's ORM to return attributes of models as Unicode
>
> If you're on a recent subversion checkout, it does.
>
> But I think your problem may be the other direction-- does Genshi
> expect Unicode in its .generate call?
>
> It could be that Django is giving Unicode, but Genshi doesn't know
> what to do with it.

AFAIK Genshi is prepared for Unicode and expects it, however Django
returns the following (name is a db column):

>>> x = AdSpaceType.objects.all()
>>> x[0].name.__class__


I'll probably try SVN, but dunno about my hosting provider...

Cheers,
Dan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Jeremy Dunck

On 7/9/07, Daniel Kvasnicka jr. ...
> stream = loader.load('index.xml').generate(
> types = 
> AdSpaceType.objects.all(),
...
>   UnicodeDecodeError at /
>   'ascii' codec can't decode byte 0xc5 in position 1: ordinal not in
> range(128)
...
>
> I simply need Django's ORM to return attributes of models as Unicode

If you're on a recent subversion checkout, it does.

But I think your problem may be the other direction-- does Genshi
expect Unicode in its .generate call?

It could be that Django is giving Unicode, but Genshi doesn't know
what to do with it.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Beginner's question

2007-07-09 Thread Chris Rich

Hi all,
  Quick question.  Is there any way to add a verbose name for one of
my apps?  I have an app named my_transfers and in the admin index view
it displays it as

My_Transfers
---
-model 1
-model 2
-blah blah blah... etc

A minor point =).

Thanks in advance.

Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.

On Jul 9, 11:14 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 7/9/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
>
>
>
> ...
> > Django dies with:
>
> Dies with... what?

Sorry, accidentally pressed Enter ;-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.

Hi Djangees,

I'm trying to use Genshi templating system with Django 0.96 but I'm
stuck with unicode.

I have a db in MySQL 5.0.38 (MySQLdb 1.2.2), the db has encoding
utf8_unicode_ci, the table I'm reading data from has the same encoding
and even the appropriate fields are in utf8_unicode_ci.

The admin site works like a charm, but when I retrieve the data from
the db and pass it to a Genshi template like this:

stream = loader.load('index.xml').generate(
types = 
AdSpaceType.objects.all(),
 )

return HttpResponse(stream.render('xhtml'))

Django dies with:

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File "/home/android/www/publicita/web/publicita/../publicita/pubapp/
views.py" in index
  20. return HttpResponse(stream.render('xhtml'))

  UnicodeDecodeError at /
  'ascii' codec can't decode byte 0xc5 in position 1: ordinal not in
range(128)

I simply need Django's ORM to return attributes of models as Unicode
objects, not str objects. How can I solve this without applying
unicode() to every single attribute? Can this be solved without
hacking Django itself? (I can't do that on a regular webhosting)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Jeremy Dunck

On 7/9/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
>
...
> Django dies with:
>


Dies with... what?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.

Hi Djangees,

I'm trying to use Genshi templating system with Django but I'm stuck
with unicode.

I have a db in MySQL 5.0.38 (MySQLdb 1.2.2), the db has encoding
utf8_unicode_ci, the table I'm reading data from has the same encoding
and even the appropriate fields are in utf8_unicode_ci.

The admin site works like a charm, but when I retrieve the data from
the db and pass it to a Genshi template like this:

stream = loader.load('index.xml').generate(
types = 
AdSpaceType.objects.all(),
 )

return HttpResponse(stream.render('xhtml'))

Django dies 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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: installation issues

2007-07-09 Thread surfwizz

I had trouble running the install as per the instructions (using
terminal), so I just ran setup.py in IDLE as a module.  Is there a way
to fix this, or get this install running properly?

On Jul 8, 10:27 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/9/07, surfwizz <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am having trouble installing Django on Mac OSX 10.4.10.  Any help
> > would be welcome.  Thanks!
>
> Django works fine on MacOSX - I'm developing on OSX right now.
>
> If you want help, you're going to need to ask a specific question.
> What part of the installation is causing you difficulty? What have you
> done? what hasn't worked as you expected?
>
> Yours
> Russ Magee %-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Ticket #399 (Bigint field object needed) status

2007-07-09 Thread Peter Nixon

Hi Guys

I am a relative newcommer to the Django world (a couple of months), so this 
is my first post to the list. Let me first say how quickly I fell in love 
with the power and flexibility of Django. Keep up the good work.

I have a question however. While trying to interface with an existing SQL 
table I stumbled across the problem that Django doesn't currently support 
BIGINT field types. I managed to track down a ticket in the tracker which 
has been open for for 2 year which appears to fix this problem:

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

Is there any reason why this patch has not been applied in one form or 
another? Partial/imperfect support  for BIGINT would IMHO be better than 
nothing..

Regards
-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dump an object

2007-07-09 Thread Carl Karsten

Jeremy Dunck wrote:
> On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> Right look, wrong source.  My {{object}} is the results of a calendar display
>> with a bunch of these: http://dell29:8000/eventcal/detail/600/
> 
> I seriously doubt "dell29:8000" is resolvable for me.  :)

http://calendar.personnelware.com/eventcal/

user1 pass1

give it a wirl

Carl

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Returning a javascript command

2007-07-09 Thread Don Spaulding II

I think you meant to escape those single-quotes in your js call:

return
render_to_response('javascript:AjaxTabs.OpenTab(getUniqueId("tab_page"),"Success","html/
test.html",true,\'\')', {'generic': file })


Rishtastic wrote:
> Right now I am trying;
> ...
> return
> render_to_response('javascript:AjaxTabs.OpenTab(getUniqueId("tab_page"),"Success","html/
> test.html",true,'')', {'generic': file })
> ...
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: bug in unique_for_year with 0.96?

2007-07-09 Thread Carl Karsten

Filippo Santovito wrote:
> I'm trying to use unique_for_year but it seems the Admin simply
> ignores this constraint:
> i'm using this model for testing and I'm able to add two entry with
> the same date:
> 
> class MyModel(models.Model):
> class Admin:
> pass
> mydata = models.DateField()
> myfield = models.CharField(maxlength=10,
> unique_for_year="mydata")
> 
> Am I missing anything or is it a bug?

I think you are missing something: the two myfield values need to be the same. 
'a' and 'a' for instance.  'a' and 'b' in the same year is ok.


It works OK for me under SVN, with a small issue that is almost a bug:  the 
error message mentions the month, as if it was important.  the month mentioned 
is the month of the entry being rejected, and implies that there is existing db 
data in that month.

Carl K

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Returning a javascript command

2007-07-09 Thread Rishtastic

Hi, I am using ajax tabbed browsing to load up pages. When a user
uploads a file, I want a new tab to open up, which can normally be
done by calling a javascript function. The problem is I don't know how
to return a javascript command in my view.

Right now I am trying;

return
render_to_response('javascript:AjaxTabs.OpenTab(getUniqueId("tab_page"),"Success","html/
test.html",true,'')', {'generic': file })

Rather, the command just reloads the entire page and results in error.

Are there any fixes to this situation?

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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: CSS question: django on apache/mod_python

2007-07-09 Thread [EMAIL PROTECTED]


> The results of the above telnet
> *should* (on a compliant proxy) leak a little info about the
> proxy server in the HTTP headers.

Got it!  Thanks -- I looked at the HTTP header for the CSS file, and
'Vary' was set to 'cookie'.  Cleared cookies in my browser (not a
default when clearing cache & other data), and there were the CSS
changes.

-Heather


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: installation issues

2007-07-09 Thread Joseph Heck

Where are you getting stuck? I assume you it works - it's just a
matter of getting the pieces/parts installed.

-joe

On 7/8/07, surfwizz <[EMAIL PROTECTED]> wrote:
>
> I am having trouble installing Django on Mac OSX 10.4.10.  Any help
> would be welcome.  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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django books application i18n

2007-07-09 Thread Joseph Heck

Even with generic views, you have custom templates. For anything in
the template, first {% load i18n %} and then follow the instructions
for internationalizing the text on the template.

If it's something coming from your inside model, there's really no
option for internationalizing that data aside from something you do
yourself. To use the i18n functionality, the text has to be known
ahead of time - there's nothing built in to django to automagically
translate words from one language to another.

If this doesn't answer your question - take another stab at asking it.
I'm not 100% sure I understood what you were asking.

-joe

On 7/8/07, Gianluca <[EMAIL PROTECTED]> wrote:
>
> Thanks...but in my case?
> I have thought to extends the "change_form.html" generic template. But
> how can I refer to a field of my data model? ( book name field for
> example)
>
> Thanks.
>
> Joseph Heck ha scritto:
>
> > I think most everything that you'd like to know is detailed out at
> > http://www.djangoproject.com/documentation/i18n/
> >
> > -joe
> >
> > On 7/6/07, Gianluca <[EMAIL PROTECTED]> wrote:
> > >
> > > Hello,
> > > I'm following the Django tutorial about books application. How can I
> > > internationalize this application?
> > > For example, how can I internationalize a field name of insert book
> > > form?
> > > Thanks
> > >
> > > Gianluca
> > >
> > >
> > > >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: CSS question: django on apache/mod_python

2007-07-09 Thread Tim Chase

> I'm running Django 0.95 on Apache 2.0, using mod_python 3.3.1,
> and I use SSH to connect to my server.  After a few days of
> shuffling and cursing and fiddling, I've got everything
> running nicely: apps work, dbs work, templates work, css
> works.  But, I've found that when I make CSS changes, it can
> be 20 minutes or more before they "take" (eg. before I can see
> them when I open the site up in a browser), even after
> restarting the server.  But, template and code changes 'take' 
> immediately (or right after a server restart).

I'd try to narrow down where the problem is:

-if it's on the browser, using a 2nd browser on that machine 
should not pick up wrongly-cached stuff from the 1st browser.

-if it's on the server, you should be able to

   [EMAIL PROTECTED] telnet example.com 80
   GET /path/to/file.css HTTP/1.1
   Host: example.com

   [correct output?]

Another possibility might be a transparently caching proxy 
between you and the server.  The results of the above telnet 
*should* (on a compliant proxy) leak a little info about the 
proxy server in the HTTP headers.  If this is the case, things 
may be working properly, as caches should obey their headers, 
which should give them permission to cache things for a spell 
(such as 20-30 annoying minutes)

If so, you should be able to hit the server *from* the *server*:

   [EMAIL PROTECTED] telnet localhost 80
   GET /path/to/file.css HTTP/1.1
   Host: example.com

(make sure that if the proxy is listening on port 80, and 
redirecting to port X that you change the "80" to the appropriate 
"X"...this would be in your server configuration)

Once you know which of the three situations is the case (a messed 
up browser cache, a messed up server, or a messed up proxy), you 
can take appropriate action.  This may be clearing your cache 
(you've already tried), ensuring the server process really did 
restart, or changing your outbound headers to reduce caching time 
until you know it's working properly.

It would also be helpful to know who (apache or django) is 
handling these media files.

-tim





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms-admin: defaults and radio select

2007-07-09 Thread leifbyron

Hi Allen,

The RadioSelect widget is actually one of the more complicated ones in
newforms. Its render method returns a RadioFieldRenderer object, which
in turn utilizes the RadioInput widget. The problem with using a
RadioSelect widget in newforms-admin is that the template is expecting
each widget to produce a unicode string, not a non-string object. So
when the RadioSelect widget returns a RadioFieldRenderer object to the
template, an error is triggered.

Luckily, this problem is easy to fix by subclassing RadioSelect like
so:

class AdminRadioSelect(forms.widgets.RadioSelect):
def render(self, name, value, attrs=None, choices=()):
   renderer =
super(AdminRadioSelect,self).render(name,value,attrs,choices)
   return renderer.__unicode__()

This, of course, is pretty hackish. I am not sure if a ticket is open
to solve this problem. But at least this code suffices for now.

As for initial values ... are you referring to the values of a saved
object as rendered on a change form, or the default values (as defined
in the model) on the add form?

Leif


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



CSS question: django on apache/mod_python

2007-07-09 Thread [EMAIL PROTECTED]

Hey all --

I've run into an unexpected situation, but feel it may be due more to
my inexperience than any innate weirdness.  Perhaps someone can
explain?

I'm running Django 0.95 on Apache 2.0, using mod_python 3.3.1, and I
use SSH to connect to my server.  After a few days of shuffling and
cursing and fiddling, I've got everything running nicely: apps work,
dbs work, templates work, css works.  But, I've found that when I make
CSS changes, it can be 20 minutes or more before they "take" (eg.
before I can see them when I open the site up in a browser), even
after restarting the server.  But, template and code changes 'take'
immediately (or right after a server restart).

I do see the CSS changes eventually, but during the 20-minutes-or-so
waiting period, the site seems to be pulling up the previous version
of the CSS file, according to my web browser (Firefox and Opera).  The
old version, however, is nowhere to be found on my web server.  I've
tried clearing my browser cache, which doesn't work either.

Is this normal?  I'm new to mod_python and fairly new to Apache, so
maybe it is completely expected and I just wasn't aware.  Or, maybe
I've done something wrong?  Or perhaps its a browser problem?  If it
is completely expected, how do others here deal with it?

Appreciative of any insight!

Heather Yager
Biodiversity Database Programmer @ The Academy of Natural Sciences


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms-admin: defaults and radio select

2007-07-09 Thread leifbyron

Hi Allen,

The RadioSelect widget is actually one of the more complicated ones in
newforms. Its render method returns a RadioFieldRenderer object, which
in turn utilizes the RadioInput widget. The problem with using a
RadioSelect widget in newforms-admin is that the template is expecting
each widget to produce a unicode string, not a non-string object. So
when the RadioSelect widget returns a RadioFieldRenderer object to the
template, an error is triggered.

Luckily, this problem is easy to fix by subclassing RadioSelect like
so:

class AdminRadioSelect(forms.widgets.RadioSelect):
def render(self, name, value, attrs=None, choices=()):
renderer =
super(AdminRadioSelect,self).render(name,value,attrs,choices)
return renderer.__unicode__()

This, of course, is pretty hackish. I am not sure if a ticket is open
to solve this problem. But at least this code suffices for now.

As for initial values ... are you referring to the values of a saved
object as rendered on a change form, or the default values (as defined
in the model) on the add form?

Leif



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User Profiles and Save()

2007-07-09 Thread Chris Kelly

Ok. That's what I thought, but just wanted to make sure I wasn't
missing something somewhere. Wasn't sure if this was a special case,
as the AUTH_PROFILE_MODULE is used for get_profile, perhaps it was
used to save/ sync the models.

Thanks again!

-C

On Jul 9, 11:58 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/9/07, Chris Kelly <[EMAIL PROTECTED]> wrote:
>
> > Or do I have to manually manage saving both objects when making a
> > change? If so, what's the preferred way to do this? by managing the
> > profile via the user object, or by managing the user object via the
> > profile (overriding the profile save method)?
>
> You must manually create and manually save the related profile object,
> just as you'd have to manually create and manually save any other type
> of related object.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



bug in unique_for_year with 0.96?

2007-07-09 Thread Filippo Santovito

I'm trying to use unique_for_year but it seems the Admin simply
ignores this constraint:
i'm using this model for testing and I'm able to add two entry with
the same date:

class MyModel(models.Model):
class Admin:
pass
mydata = models.DateField()
myfield = models.CharField(maxlength=10,
unique_for_year="mydata")

Am I missing anything or is it a bug?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: unicode trouble

2007-07-09 Thread Matt Davies
I think I need some way of asking what the current stream I'm getting is
formatted in.

I've found a way around it now, with a combination of

if isinstance(self.summary,basestring):

and
if isinstance(self.summary,unicode):

I'm sure I must be doing something wrong here, it seems I'm switching back
and for between utf8 and unicode all the time.

hmm

On 09/07/07, Matt Davies <[EMAIL PROTECTED]> wrote:
>
> ok, I've done a bit more troubleshooting and it seems the problem isn't in
> the models.py, it's in the edit_event function.
>
> in there I'm defining things like this
>
> e.summary = cleaned_data['summary']
>
> If I encode that bit like this now
>
> e.summary = cleaned_data['summary'].encode('utf-8')
>
> the problem shifts back to the models.py file
>
> so, back in the models.py now if I comment out the encode('utf8) in the
> summary and the body, it works.
>
> But now, if you go and add a new event it will fail at that point in the
> models file.
>
> Here's a summary
> http://pastie.caboo.se/77325
>
>
>
> On 09/07/07, vanderkerkoff <[EMAIL PROTECTED]> wrote:
> >
> > Hello everyone, using newest django trunk as of today
> >
> > I've written a save overide in my models file to textile the entries,
> > here's the bit of that code I'm having trouble with.
> > def __unicode__(self):
> > return self.title
> >
> > def save(self):
> > if self.summary:
> > self.summary = self.summary.encode('utf8')
> > self.summary_html = textile.textile(self.summary
> > )
> > if self.body:
> > self.body = self.body.encode('utf8')
> > self.body_html = textile.textile(self.body)
> > super(Event, self).save()
> >
> > The edit event and add event functions in the view are almost
> > identical, but the problem I'm getting happens before we get to the
> > views file.
> >
> > My web site and dbase are utf-8.
> >
> > If I add a record with special characters pasted from word the first
> > time, it all works sweet.  Textile does it's magic, and the odd
> > characters do the round trip and look fine.  I can then approve them
> > from the admin backend, or edit them from the backend without any
> > trouble at all.
> >
> > But if I try to edit a record with those characters in them from the
> > front end, it falls over on this line
> > self.summary = self.summary.encode('utf8')
> >
> > 'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in
> > range(128)
> >
> > I think, but I'm not sure, that the problem is on the first go round
> > I'm putting it in the web as utf8, django is grabbing it and newforms
> > are sending it to the save as unicode, my code is character encoding
> > the unicode as utf8 and that's fine.
> >
> > Second go round I'm not sure what's happening or what is different
> > about the nature of the string.  I assumed it would be coming to me as
> > unicode string again and encoding it like that would work, but that
> > deosn't seem to be the case.
> >
> > I'd appreciate any sort of help at all, suggestions or links to
> > reading, but I've read a fair bit about this already in my pursuit to
> > have django and textile and solr and odd characters from word all work
> > together.
> >
> > Is my dream a dream and not going to be a reality?
> >
> > Cheers.
> >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User Profiles and Save()

2007-07-09 Thread James Bennett

On 7/9/07, Chris Kelly <[EMAIL PROTECTED]> wrote:
> Or do I have to manually manage saving both objects when making a
> change? If so, what's the preferred way to do this? by managing the
> profile via the user object, or by managing the user object via the
> profile (overriding the profile save method)?

You must manually create and manually save the related profile object,
just as you'd have to manually create and manually save any other type
of related object.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



User Profiles and Save()

2007-07-09 Thread Chris Kelly

I am looking to attach a profile to the Django user object based on
the b-list article, and had a question regarding saving models.

Does/ should the profile be automatically saved at the same time the
User model is saved? e.g. if I call a save on the user object, and
i've got the AUTH_PROFILE_MODULE correctly set, should the associated
profile object be saved automatically as well? Right now it doesn't
seem to, and I'm wondering if I need to set something else, e.g.
profile_callback (which from what I can find on it, would only work
when creating the object).

Or do I have to manually manage saving both objects when making a
change? If so, what's the preferred way to do this? by managing the
profile via the user object, or by managing the user object via the
profile (overriding the profile save method)?

Thanks in advance,

-Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: unicode trouble

2007-07-09 Thread Matt Davies
ok, I've done a bit more troubleshooting and it seems the problem isn't in
the models.py, it's in the edit_event function.

in there I'm defining things like this

e.summary = cleaned_data['summary']

If I encode that bit like this now

e.summary = cleaned_data['summary'].encode('utf-8')

the problem shifts back to the models.py file

so, back in the models.py now if I comment out the encode('utf8) in the
summary and the body, it works.

But now, if you go and add a new event it will fail at that point in the
models file.

Here's a summary
http://pastie.caboo.se/77325



On 09/07/07, vanderkerkoff <[EMAIL PROTECTED]> wrote:
>
> Hello everyone, using newest django trunk as of today
>
> I've written a save overide in my models file to textile the entries,
> here's the bit of that code I'm having trouble with.
> def __unicode__(self):
> return self.title
>
> def save(self):
> if self.summary:
> self.summary = self.summary.encode('utf8')
> self.summary_html = textile.textile(self.summary)
> if self.body:
> self.body = self.body.encode('utf8')
> self.body_html = textile.textile(self.body)
> super(Event, self).save()
>
> The edit event and add event functions in the view are almost
> identical, but the problem I'm getting happens before we get to the
> views file.
>
> My web site and dbase are utf-8.
>
> If I add a record with special characters pasted from word the first
> time, it all works sweet.  Textile does it's magic, and the odd
> characters do the round trip and look fine.  I can then approve them
> from the admin backend, or edit them from the backend without any
> trouble at all.
>
> But if I try to edit a record with those characters in them from the
> front end, it falls over on this line
> self.summary = self.summary.encode('utf8')
>
> 'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in
> range(128)
>
> I think, but I'm not sure, that the problem is on the first go round
> I'm putting it in the web as utf8, django is grabbing it and newforms
> are sending it to the save as unicode, my code is character encoding
> the unicode as utf8 and that's fine.
>
> Second go round I'm not sure what's happening or what is different
> about the nature of the string.  I assumed it would be coming to me as
> unicode string again and encoding it like that would work, but that
> deosn't seem to be the case.
>
> I'd appreciate any sort of help at all, suggestions or links to
> reading, but I've read a fair bit about this already in my pursuit to
> have django and textile and solr and odd characters from word all work
> together.
>
> Is my dream a dream and not going to be a reality?
>
> Cheers.
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Table shared by 2 application

2007-07-09 Thread Haku

Ok, thank you KpoH!
This is cool!

Haku


On 9 Lug, 17:15, KpoH <[EMAIL PROTECTED]> wrote:
> mistype
>
> from your_project.apps.forum.models import Forum
>
> KpoH пишет:
>
>
>
> > example:
>
> > apps/manage/models.py
>
> > from django.db import models
> > from your_project.apps.models import Forum
>
> > class ForumManager(models.Model):
> > forum  models.ForeignKey(Forum)
> > ... and so on
>
> > but model Forum will be in
>
> > apps/forum/models.py
>
> > Haku writes:
>
> >> Hi all, this is my second help request in the ML, sorry i i'm wrong
> >> with something!
>
> >> I have a question:
> >> Suppose i need a db table named "users".
> >> Now, this table should be used by 2 aplication of my site: "forum" and
> >> "Manage".
>
> >> How can i do it? I mean, where i define the table in "Forum" or in
> >> "Manage"?
> >> And how to set the sharing?
>
> >> Sorry for my ugly english!!
>
> >> Thnx in advance.
>
> >> Haku
>
> --
> Artiom Diomin, Development Dep, "Comunicatii Libere" 
> S.R.L.http://www.asterisksupport.ruhttp://www.asterisk-support.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: faking request path

2007-07-09 Thread Carl Karsten

[EMAIL PROTECTED] wrote:
> Hello all!
> 
> Is there an easy way to fake the request path in django and/or pyton?
> I'm looking for something like this:
> a django page which is called with this URL: 
> http://www.test.ch/test1/test2/test3
> should thinks it is run in the top-folder that means: http://www.test.ch
> 
> I need that because I have to use somehow already given templates,
> which I cannot edit, and which believe they are always run in the top-
> domain folder.
> 

I'm not really sure what you mean by "believe' ...  maybe post some template 
code and resulting links.

My guess is you can do what you in urls.py.

This is sounding like the "portable app" problem, discussed at
http://groups.google.com/group/django-hotclub

Carl K

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Table shared by 2 application

2007-07-09 Thread KpoH

mistype

from your_project.apps.forum.models import Forum



KpoH пишет:
> example:
>
> apps/manage/models.py
>
> from django.db import models
> from your_project.apps.models import Forum
>
> class ForumManager(models.Model):
> forum  models.ForeignKey(Forum)
> ... and so on
>
> but model Forum will be in
>
> apps/forum/models.py
>
> Haku writes:
>   
>> Hi all, this is my second help request in the ML, sorry i i'm wrong
>> with something!
>>
>> I have a question:
>> Suppose i need a db table named "users".
>> Now, this table should be used by 2 aplication of my site: "forum" and
>> "Manage".
>>
>> How can i do it? I mean, where i define the table in "Forum" or in
>> "Manage"?
>> And how to set the sharing?
>>
>> Sorry for my ugly english!!
>>
>> Thnx in advance.
>>
>> Haku
>>
>>
>> 
>>   
>> 
>
>   

-- 
Artiom Diomin, Development Dep, "Comunicatii Libere" S.R.L.
http://www.asterisksupport.ru
http://www.asterisk-support.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Table shared by 2 application

2007-07-09 Thread KpoH

example:

apps/manage/models.py

from django.db import models
from your_project.apps.models import Forum

class ForumManager(models.Model):
forum  models.ForeignKey(Forum)
... and so on

but model Forum will be in

apps/forum/models.py

Haku writes:
> Hi all, this is my second help request in the ML, sorry i i'm wrong
> with something!
>
> I have a question:
> Suppose i need a db table named "users".
> Now, this table should be used by 2 aplication of my site: "forum" and
> "Manage".
>
> How can i do it? I mean, where i define the table in "Forum" or in
> "Manage"?
> And how to set the sharing?
>
> Sorry for my ugly english!!
>
> Thnx in advance.
>
> Haku
>
>
> >
>   

-- 
Artiom Diomin, Development Dep, "Comunicatii Libere" S.R.L.
http://www.asterisksupport.ru
http://www.asterisk-support.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



unicode trouble

2007-07-09 Thread vanderkerkoff

Hello everyone, using newest django trunk as of today

I've written a save overide in my models file to textile the entries,
here's the bit of that code I'm having trouble with.
def __unicode__(self):
return self.title

def save(self):
if self.summary:
self.summary = self.summary.encode('utf8')
self.summary_html = textile.textile(self.summary)
if self.body:
self.body = self.body.encode('utf8')
self.body_html = textile.textile(self.body)
super(Event, self).save()

The edit event and add event functions in the view are almost
identical, but the problem I'm getting happens before we get to the
views file.

My web site and dbase are utf-8.

If I add a record with special characters pasted from word the first
time, it all works sweet.  Textile does it's magic, and the odd
characters do the round trip and look fine.  I can then approve them
from the admin backend, or edit them from the backend without any
trouble at all.

But if I try to edit a record with those characters in them from the
front end, it falls over on this line
self.summary = self.summary.encode('utf8')

'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in
range(128)

I think, but I'm not sure, that the problem is on the first go round
I'm putting it in the web as utf8, django is grabbing it and newforms
are sending it to the save as unicode, my code is character encoding
the unicode as utf8 and that's fine.

Second go round I'm not sure what's happening or what is different
about the nature of the string.  I assumed it would be coming to me as
unicode string again and encoding it like that would work, but that
deosn't seem to be the case.

I'd appreciate any sort of help at all, suggestions or links to
reading, but I've read a fair bit about this already in my pursuit to
have django and textile and solr and odd characters from word all work
together.

Is my dream a dream and not going to be a reality?

Cheers.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Table shared by 2 application

2007-07-09 Thread Haku

Hi all, this is my second help request in the ML, sorry i i'm wrong
with something!

I have a question:
Suppose i need a db table named "users".
Now, this table should be used by 2 aplication of my site: "forum" and
"Manage".

How can i do it? I mean, where i define the table in "Forum" or in
"Manage"?
And how to set the sharing?

Sorry for my ugly english!!

Thnx in advance.

Haku


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with session persistence

2007-07-09 Thread flynnguy

Ok, I upgraded to the development version of django and that didn't
help. I then started to try and trim out the code so it was of a more
manageable size to post here. It's still rather large but if it helps
anyone visualize what I'm talking about, here it is:

## test_indexs.html
Take the Test


{{ form }}





## take_tests.html
{{ questions_asked }}

{% if score_page %}
{{ num }}
Your score is: {{ score|floatformat:2 }}%
({{ num_correct }}/{{ total }})

{% else %}

{{ question.id }} {{ question.question }}



{% for answer in answers %}

{% endfor %}


{% endif %}

## views.py
def sessiontest(request):
if 'questionlist' in request.session:
questions_asked = request.session['questionlist']
if request.method == "POST":
if request.session.get('num_questions',False):  # If there
is a GET var called num_questions
if request.session['current_question'] <
request.session['num_questions']:
request.session['current_question'] += 1
question = Question.objects.order_by('?')[0]# Get
a random question
request.session['previous_question'] = question
answers = list(enumerate([question.correct_answer,
question.other_answer_1, question.other_answer_2]))
shuffle(answers)
try:
request.session['questionlist'] =
questions_asked.append(int(question.id))
except AttributeError:
request.session['questionlist'] =
[(int(question.id)),]

return render_to_response('take_tests.html',
{'current_num':request.session['current_question'], \
 
'num':request.session['num_questions'], \
 
'question':question, \
 
'first_page':False, \
 
'questions_asked':questions_asked, \
 
'answers': answers})
else:
score = (float(request.session['num_correct'])/
float(request.session['num_questions']))*100
return render_to_response('take_tests.html',
{'correct':request.session['num_correct'], \
 
'total':request.session['num_questions'], \
 
'score':score, \
 
'score_page':True, \
 
'num_correct':request.session['num_correct'] })
else:   # No num_questions var set... show/process form
form = TestForm(request.POST)
if form.is_valid():
num_questions =
form.cleaned_data['number_of_questions']
request.session['num_questions'] = num_questions
request.session['current_question'] = 1
request.session['num_correct'] = 0
question = Question.objects.order_by('?')[0]# Get
a random question
request.session['previous_question'] = question
answers = list(enumerate([question.correct_answer,
question.other_answer_1, question.other_answer_2]))
shuffle(answers)
request.session['previous_answers'] = answers
request.session['questionlist'] = [int(question.id),]
#topics = request.POST['topics']
return render_to_response('take_tests.html',
{'current_num':request.session['current_question'], \
 
'num':num_questions, \
 
'first_page':True, \
 
'questions_asked':request.session['questionlist'], \
 
'question':question, 'answers': answers,})
else:
# Remove num_questions session key in case it is hanging
around
try:
del request.session['num_questions']
except KeyError:
pass
form = TestForm()
return render_to_response('test_indexs.html', {'form':form})


## End Code ###

If there is a problem storing lists in the session variables, then I
can look at some other method. I just thought this would be the best
solution. Also it works some of the time, just not all of the time. I
don't understand why it's getting set to 'None'.
-Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Locale problem in method prefork

2007-07-09 Thread bluszcz

Hi.

I am using apache 2.0 + fastcgi

When I used method=prefork in fastcgi method, i found a strange
bahviour - sometimes application response with untranslanted string
(especially from models.py). On method threaded everything is ok -
without stability - server hangs during heavy load.

Any ideas?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



faking request path

2007-07-09 Thread [EMAIL PROTECTED]

Hello all!

Is there an easy way to fake the request path in django and/or pyton?
I'm looking for something like this:
a django page which is called with this URL: 
http://www.test.ch/test1/test2/test3
should thinks it is run in the top-folder that means: http://www.test.ch

I need that because I have to use somehow already given templates,
which I cannot edit, and which believe they are always run in the top-
domain folder.

Thanks in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



The World's First,Free & Largest Collection of the Applications & Softwares, Audio,Video & Miscellaneous Conerters , Audio,Video & Miscellaneous Splitters, Games, Themes, Screen Savers, Wallpapers,

2007-07-09 Thread FunKitPk

The World's First,Free & Largest Collection of the Applications &
Softwares, Audio,Video & Miscellaneous Conerters , Audio,Video &
Miscellaneous  Splitters,  Games, Themes, Screen Savers, Wallpapers,
Secret Codes, Video+Audio+MP3+AMR+MIDI+MMF+Polyphonic+Monophonic+True
Ringtones, 3GP+AVI+MP4+Funny+Music+Jokes+Amazing+Wopndering+True Event
Videos, Operator Logos,Start Up Logos, MMS Pictures, Graphics, SMS
Linogs, SMS Pictures & Text Messages, SMS Jokes, SMS Information, Free
SMS Sending ( Web 2 SMS ),SMS Tutorials, Islamic Stuffs, Mobile Set
Reviews, Mobile Tips+Tricks, Mobile Format Codes,Mobile Rates & Lot
More Interesting & Useful Mobile Stuffs for the International Famous
Mobile Manufacturers Companies  including Alcatel, Bosch, LG, I-Mate,
Mitsubishi, Motorola, Nokia, Panasonic, Pocket PCs, Philips, Sagem,
Samsung, Siemens, Smart-Phone, Sony, Sony Ericsson,  UIQ & other
companies Etc.Also More Cool,excited,top & free computer & mobile and
other stuffs to explore at the website http://funkitpk.110mb.com Also
on coming new website located at http://funkitpk.quotaless.com. So
don't miss out them and start exploring them.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Can textarea attributes (rows, cols) be specified for django admin interface

2007-07-09 Thread ao

Hi,

You can specify a custom css class in fields attribute in admin
options:
http://www.djangoproject.com/documentation/model-api/#admin-options

Eg.:
fields = (
('Advanced', {
'classes': 'mycustomcssclass',
'fields': ('url', 'title', 'content', 'sites'),
})...

(this also works in newforms-admin branch I believe)

On Jul 9, 9:16 am, Shankar <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Is it possible to specify HTML attributes (rows, cols) for textarea
> (TextField) widgets that appear in django's admin interface? If so, some
> pointers would be great.
>
> Thanks,
> Shankar


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Remove a field from a form

2007-07-09 Thread ilDave

I read this on the documentation, but I'm usinge the 0.96 versione,
non the development one, so I can't use it...
But Nathan's method worls well :)


On Jul 9, 1:04 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/9/07, ilDave <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi!
> > I have to show two identical forms in a page, so I used form_for_model
> > and I created two form objects.
> ...
> > What am I missing?
>
> Try form_for_model(MyModel, fields=('field1','field2')). That will
> generate a form for MyModel that only contains the named fields.
>
> Yours,
> Russ Magee %-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dump an object

2007-07-09 Thread Carl Karsten

Jeremy Dunck wrote:
> On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> Right look, wrong source.  My {{object}} is the results of a calendar display
>> with a bunch of these: http://dell29:8000/eventcal/detail/600/
> 
> I seriously doubt "dell29:8000" is resolvable for me.  :)

actually it was just the eventcal/detail/600/ I wanted to show.  but if you are 
interested, I'll setup a public url.  I'll need to find some sample data.  and 
make coffee.  I'll let you know when it is up.

> 
> 
>> But that circumvents the view and {% extends "main.html" %} and the plan to 
>> hear
>> "yes, that is the right data, lets make it look pretty" and have some clue 
>> what
>> attributes object has, just by looking at the 'raw' version rendered in the
>> browser.
> 
> Sorry, I don't follow.  :-/

I am looking for a tag that does introspection of objects passed to templates.

databrowse takes an ID, gets the record from the db and displays the results in 
a pleasing fashion: attributes and data, alternating colors.

I want a similar display, but for an object created in a view, and in my own 
template.  I like the alternating colors, but I can do without them.

{%debug%} is similar to what I want.  Not used by the end user in a final 
product, just something handy for development.

the generic view (and most custom views) create something like this:
 >>> object={'a':1, 'b':'hello'}

in a template, I want a generic way to show it's attributes and their values:
 >>> for i in object: print i, object[i]
a 1
b hello

hmm, I see a slight problem: it really needs a bit of html.
 >>> for i in object: print "%s%s" % (i, object[i])
...
a1
bhello

I can see a few ways of dealing with the need for html - something like this: 
http://code.djangoproject.com/wiki/ColumnizeTag  "This tag will create 
 
and  tags around everything between..."

or even just display the dict in python dict notaion:
 >>> object
{'a': 1, 'b': 'hello'}

At this point, the person who is going to actually code the template can see 
what attributes/values object has, and can create a real template using 
{{object.a}} and {{object.b}}



Carl K



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms-admin: defaults and radio select

2007-07-09 Thread _

Thanks Leif! I'll try to play around with the radio widget today. The
question about defaults was more simple. Formerly I had a model class
with default="0.0" or default=datetime.date.today() How do I reproduce
that with newforms-admin? Is there any easier way to provide initial
values (that's what I meant by defaults... poor choice of words) than
this?:

def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'date':
kwargs['initial'] = date.today
return
super(ModelOptions,self).formfield_for_dbfield(db_field, **kwargs)

On Jul 9, 1:18 am, leifbyron <[EMAIL PROTECTED]> wrote:
> Hi Allen,
>
> I'm no Django expert (in fact, I just started learning a month ago),
> but I'm happy to share what I have discovered so far.
>
> >From what I can tell, the only way to override the default widget or
>
> field for a model's database field is to subclass the Options class
> and override the kwargs['widget'] for the field. For more info, check
> out my earlier post:
>
> http://groups.google.com/group/django-users/browse_thread/thread/beba...
>
> But there's a complication in the case of the radio widget. I could be
> mistaken, but I was unable to get it to work withnewforms-admin. I
> had to create my own subclassed radio widget and use that instead.
> (The problem was that the radio widget was returning a "radio field
> renderer" object, not the actual code as a unicode string.)
>
> If you're interested in the details, I can post my solution tomorrow
> when I'm at the office. But if anyone with more intimate knowledge 
> ofnewforms-adminhas a better solution, I do hope he'll chime in.
>
> Cheers,
> Leif
>
> On Jul 8, 7:38 pm, _ <[EMAIL PROTECTED]> wrote:
>
> > Hi folks,
>
> > I'm doing my best to convert over to thenewforms-adminmodel. There
> > are three things that used to be model kwargs that I'm having
> > difficulty converting over: default values and radio_admin.. Any tips?
> > Do I
> > have to tie these things into formfield_for_dbfield() in the Options
> > class?
>
> > Cheers,
>
> > Allen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Remove a field from a form

2007-07-09 Thread Russell Keith-Magee

On 7/9/07, ilDave <[EMAIL PROTECTED]> wrote:
>
> Hi!
> I have to show two identical forms in a page, so I used form_for_model
> and I created two form objects.
...
> What am I missing?

Try form_for_model(MyModel, fields=('field1','field2')). That will
generate a form for MyModel that only contains the named fields.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Remove a field from a form

2007-07-09 Thread ilDave

I have to remove the field from the object class and not from the
class instance...

Thanks!

On Jul 9, 12:52 pm, Nathan Ostgard <[EMAIL PROTECTED]> wrote:
> Do this instead:
>
> PreventivoForm = form_for_model(Preventivo)
> del PreventivoForm.base_fields['codice']
> f = PreventivoForm()
> f2 = PreventivoForm(auto_id='id_%s2')
>
> 
> Nathan Ostgard
>
> On Jul 9, 2:33 am, ilDave <[EMAIL PROTECTED]> wrote:
>
> > Hi!
> > I have to show two identical forms in a page, so I used form_for_model
> > and I created two form objects.
> > I don't need to show a particular field, so i tried to remove it this
> > way:
>
> > def showtwoforms(request):
> > PreventivoForm =  form_for_model(Preventivo) #'Preventivo' is the
> > model
> > f = PreventivoForm()
> > if f.base_fields.has_key('codice'): #codice is the field I want to
> > get rid of
> > del f.base_fields['codice']
> > f2 = PreventivoForm(auto_id='id_%s2')
> > if f2.base_fields.has_key('codice'):
> > del f2.base_fields['codice']
> > t = loader.get_template('preventivo.html')
> > c = Context({
> >   'form' : f,
> >   'form2' : f2,
> >   })
> > return HttpResponse(t.render(c))
>
> > But when I show the page, only the second form (f2) has not the
> > 'codice' field, the first form still has it.
>
> > What am I missing?
>
> > 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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Remove a field from a form

2007-07-09 Thread Nathan Ostgard

Do this instead:

PreventivoForm = form_for_model(Preventivo)
del PreventivoForm.base_fields['codice']
f = PreventivoForm()
f2 = PreventivoForm(auto_id='id_%s2')


Nathan Ostgard

On Jul 9, 2:33 am, ilDave <[EMAIL PROTECTED]> wrote:
> Hi!
> I have to show two identical forms in a page, so I used form_for_model
> and I created two form objects.
> I don't need to show a particular field, so i tried to remove it this
> way:
>
> def showtwoforms(request):
> PreventivoForm =  form_for_model(Preventivo) #'Preventivo' is the
> model
> f = PreventivoForm()
> if f.base_fields.has_key('codice'): #codice is the field I want to
> get rid of
> del f.base_fields['codice']
> f2 = PreventivoForm(auto_id='id_%s2')
> if f2.base_fields.has_key('codice'):
> del f2.base_fields['codice']
> t = loader.get_template('preventivo.html')
> c = Context({
>   'form' : f,
>   'form2' : f2,
>   })
> return HttpResponse(t.render(c))
>
> But when I show the page, only the second form (f2) has not the
> 'codice' field, the first form still has it.
>
> What am I missing?
>
> 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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Remove a field from a form

2007-07-09 Thread ilDave

Hi!
I have to show two identical forms in a page, so I used form_for_model
and I created two form objects.
I don't need to show a particular field, so i tried to remove it this
way:

def showtwoforms(request):
PreventivoForm =  form_for_model(Preventivo) #'Preventivo' is the
model
f = PreventivoForm()
if f.base_fields.has_key('codice'): #codice is the field I want to
get rid of
del f.base_fields['codice']
f2 = PreventivoForm(auto_id='id_%s2')
if f2.base_fields.has_key('codice'):
del f2.base_fields['codice']
t = loader.get_template('preventivo.html')
c = Context({
  'form' : f,
  'form2' : f2,
  })
return HttpResponse(t.render(c))

But when I show the page, only the second form (f2) has not the
'codice' field, the first form still has it.

What am I missing?

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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



AroundWord - Blog Publishing System

2007-07-09 Thread Jonas

AroundWord_ is a free and open Blog Publishing System built on Python
using the most advanced technologies:

* Framework: Tesla upon Pylons
* Database Engine: SQLAlchemy + Elixir + SAContext
* Templates: Mako
* Widgets and Forms: ToscaWidgets + twForms + FormEncode
* Authorization and Authentication: AuthKit
* Internationalization (i18n) and Localization (L10n): Babel
* JavaScript Library: jQuery
* Site Search: Xapian

Currently, AroundWord is in early planning and development. You are
welcome to take participate in the development:

Join the `mailing list`_ and tell us what you think about this
project :)


.. _AroundWord: http://www.aroundword.org/
.. _mailing list: http://groups.google.com/group/aroundword-discuss


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: psycopg/psycopg2 - error at the loading

2007-07-09 Thread James Bennett

On 7/6/07, uxmal <[EMAIL PROTECTED]> wrote:
> using psycopg :
>  Error loading psycopg module: libpq.so.5: cannot open shared object
> file: No such file or directory

PostgreSQL's libraries often install into a location where the default
ld configuration won't find them; locate the PostgreSQL 'lib'
directory on your system, and update the ld load path to include that
directory.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database operations too slow

2007-07-09 Thread Jeremy Dunck

On 7/9/07, Santhosh <[EMAIL PROTECTED]> wrote:
> I think it may be because django
> makes a new connection and authenticates etc..

Django uses one database connection per request.
> terminate the connection only when i
> want it to..

Not easily, no.

Turn on debug, and check how many queries are being run:

from django.db import connection
print len(connection.queries)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database operations too slow

2007-07-09 Thread James Bennett

On 7/9/07, Santhosh <[EMAIL PROTECTED]> wrote:
> Im working on a small web-app using django. The problem is.. the
> database operations are too slow. I think it may be because django
> makes a new connection and authenticates etc.. to the db everytime it
> wants something..Is there some way i can make django use a single
> connection throughout and it shud terminate the connection only when i
> want it to..

Django initiates a new connection on each incoming request, and closes
it at the end of the request when it's sending out a response. There's
really no way to alter that behavior in Django, though a pooling
connection manager between Django and your database can be a great
help if this is really where your overhead is coming from.

I'd be curious, though, to know what led you to suspect this as the
problem (since plenty of sites do just fine at a variety of levels of
traffic without doing anything special for pooling connections): have
you done any profiling to verify that this really is where the
performance problems are?

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: psycopg/psycopg2 - error at the loading

2007-07-09 Thread Thomas Guettler


Look at /etc/ld.so.conf and "man ldconfig".

> When I reinstall psycopg 1 or 2 (properly configured with my lib path /
> usr/local/pgsql/lib/),
> it works (no error at the install of psycopg)
>
> but then it can't find this damn lib !
>
> ---
>
> >>> import psycopg
>
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: libpq.so.5: cannot open shared object file: No such file
> or directory

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Database operations too slow

2007-07-09 Thread Santhosh

Hi ppl,

Im working on a small web-app using django. The problem is.. the
database operations are too slow. I think it may be because django
makes a new connection and authenticates etc.. to the db everytime it
wants something..Is there some way i can make django use a single
connection throughout and it shud terminate the connection only when i
want it to..
Django version: 0.95
mysql version: 5.0.22

Thanks,
Santhosh


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to execute an external application from View

2007-07-09 Thread Knut Ivar Nesheim


Den 9. jul. 2007 kl. 06.40 skrev RayLeyva:

>
> If anyone out there has any ideas at all as to why this is please
> share.  Even if you don't know of a work around, just knowing why this
> happens would be really handy.

A working workaround:
If javascript is an option, have a look at this: http:// 
developer.yahoo.com/yui/examples/container/panelwait/1.html

Just call the view and then when your external application returns,  
the view returns the exit status and the popup closes. I use it to  
import data and generating thumbnails, etc. It works great.

:-)

-- 
Knut Ivar Nesheim




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Checkout with Tortoise SVN

2007-07-09 Thread tsc

Hallo, and thank you all very much.
I will ask my administrator and tell you if it worked.

Thanks

On 6 Jul., 23:06, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have seen this error before.
>
> It is usually because your proxy doesn't support the PROPFIND
> command.  Ask your administrator to upgrade the proxy (usually squid)
> to a version that supports this, or to reconfigure the proxy to allow
> this HTTP method.
>
> On Jul 6, 5:21 am, tsc <[EMAIL PROTECTED]> wrote:
>
> > Sorry, but I've forgotten to set the proxy server in Tortoise. Now it
> > worked a little better. But other repositories work witout the proxy
> > settings too, hmm strange.
> > Now I get another error:
> > REPORT request failed on '/svn/!svn/vcc/default'
> > REPORT of '/svn/!svn/vcc/default': 400 Bad Request (http://
> > code.djangoproject.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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Can textarea attributes (rows, cols) be specified for django admin interface

2007-07-09 Thread Shankar

Hi all,

Is it possible to specify HTML attributes (rows, cols) for textarea 
(TextField) widgets that appear in django's admin interface? If so, some 
pointers would be great.

Thanks,
Shankar


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dump an object

2007-07-09 Thread Jeremy Dunck

On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
> Right look, wrong source.  My {{object}} is the results of a calendar display
> with a bunch of these: http://dell29:8000/eventcal/detail/600/

I seriously doubt "dell29:8000" is resolvable for me.  :)


> But that circumvents the view and {% extends "main.html" %} and the plan to 
> hear
> "yes, that is the right data, lets make it look pretty" and have some clue 
> what
> attributes object has, just by looking at the 'raw' version rendered in the
> browser.

Sorry, I don't follow.  :-/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---