non-model permissions

2008-12-06 Thread mh983
What is the best way to create permissions for use in authorization if those permissions aren't related to any specific model? I can't seem to find anything to tell me how to do this. In fact, it looks like even the database tables for permissions assume they are associated with a model

Re: Removing accents from strings

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 9:00 PM, Dave Dash <[EMAIL PROTECTED]> wrote: > > Okay I think that fixes one fundamental issue... I've got a unittest, > however that fails for a function: > > def normalize(tag): >""" >>>> normalize(u'cafe') >u'cafe' >>>> normalize(u'caf e') >u'cafe' >

Re: keep html

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 9:17 PM, Patricio Palma <[EMAIL PROTECTED]>wrote: > > Is possible to get the html code from an administration page? > > > I mean, my browser is interpreting a html generated by templates and > components of my application, some banners and pictures. > > Is there any way to

Reducing the number of my view's database queries

2008-12-06 Thread erikcw
Hi all, I'm trying to write a model query that will return a queryset along with the latest (and earliest) data from 2 related models. Right now I'm doing something like this: objects = Model1.objects.filter(user=3).select_related() #about 6,000 objects data = {} for o in objects:

Re: misreporting verify_exists

2008-12-06 Thread Malcolm Tredinnick
On Sun, 2008-12-07 at 12:02 +0800, Eric Abrahamsen wrote: [...] > Thanks for the response, Malcolm. I wonder if I'm looking at the wrong > part of the code? forms.fields.URLField.clean() seems to be using a > full urllib2.urlopen, not just a HEAD request -- am I looking at the > wrong

Re: misreporting verify_exists

2008-12-06 Thread Eric Abrahamsen
On Dec 7, 2008, at 11:44 AM, Malcolm Tredinnick wrote: > > > On Sun, 2008-12-07 at 14:42 +1100, Malcolm Tredinnick wrote: > [...] > >> So have a look at the result of something like "curl -I http://... >> " (or >> equivalent tool if you don't have curl around). Basically, force a >> HEAD >>

Re: misreporting verify_exists

2008-12-06 Thread Malcolm Tredinnick
On Sun, 2008-12-07 at 14:42 +1100, Malcolm Tredinnick wrote: [...] > So have a look at the result of something like "curl -I http://... > " (or > equivalent tool if you don't have curl around). Basically, force a HEAD > request and see if that returns something sensible. Ignore me. I

Re: misreporting verify_exists

2008-12-06 Thread Malcolm Tredinnick
On Sun, 2008-12-07 at 11:32 +0800, Eric Abrahamsen wrote: > I've got a model with a URLField, with verify_exists set to True, > which has suddenly started barfing "broken link" on a certain URL. I'm > quite sure the URL exists, and can't figure out why it can't get past > validation. This

misreporting verify_exists

2008-12-06 Thread Eric Abrahamsen
I've got a model with a URLField, with verify_exists set to True, which has suddenly started barfing "broken link" on a certain URL. I'm quite sure the URL exists, and can't figure out why it can't get past validation. This is the link:

keep html

2008-12-06 Thread Patricio Palma
Is possible to get the html code from an administration page? I mean, my browser is interpreting a html generated by templates and components of my application, some banners and pictures. Is there any way to get that code? --~--~-~--~~~---~--~~ You received this

Re: Removing accents from strings

2008-12-06 Thread Dave Dash
Okay I think that fixes one fundamental issue... I've got a unittest, however that fails for a function: def normalize(tag): """ >>> normalize(u'cafe') u'cafe' >>> normalize(u'caf e') u'cafe' >>> normalize(u' cafe ') u'cafe' >>> normalize(u' café ') u'cafe'

Re: Removing accents from strings

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 7:23 PM, Dave Dash <[EMAIL PROTECTED]> wrote: > > I'm experiencing some strange behavior, and I think it has to do with > how django deals with utf strings: > > When I write a test.py file: > > import re, unicodedata > > reCombining =

Removing accents from strings

2008-12-06 Thread Dave Dash
I'm experiencing some strange behavior, and I think it has to do with how django deals with utf strings: When I write a test.py file: import re, unicodedata reCombining = re.compile(u'[\u0300-\u036f\u1dc0-\u1dff\u20d0-\u20ff \ufe20-\ufe2f]',re.U) def remove_diacritics(s): return

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Marek Wawrzyczek
You're very observant. Thanks :)) 2008/12/6 Karen Tracey <[EMAIL PROTECTED]> > On Sat, Dec 6, 2008 at 11:53 AM, Marek Wawrzyczek <[EMAIL PROTECTED]>wrote: > >> In the tutorial (http://docs.djangoproject.com/en/dev/intro/tutorial01/) >> I do everything what is written, and in the >> "Activating

Re: Ruby on Rails vs Django

2008-12-06 Thread Low Kian Seong
I think django is closer to merb http://merbivore.com/ rather than ROR. On Sat, Dec 6, 2008 at 10:48 PM, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > > > > On 6 déc, 10:55, "Guillermo C." <[EMAIL PROTECTED]> wrote: >> Hi. >> >> - Scaffolding: I prefer it over django admin in many situations.

Re: Character encoding... latin1 to utf8?

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 2:59 PM, Rob Hudson <[EMAIL PROTECTED]> wrote: > > Wow, thanks so much Karen, for slicing and dicing the problem like > that. > > On Dec 6, 10:36 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > You could also just convert the character set used on the MySQL side: > > > >

Re: Excel Generating Report

2008-12-06 Thread Low Kian Seong
Try this : response['Content-Disposition']='attachment;filename=output.xls' That worked for me. On Sun, Dec 7, 2008 at 2:14 AM, garces.85 <[EMAIL PROTECTED]> wrote: > > Hello, > > I need some urgent help. I have a function that generates a report in > excel, the report returns the data that i

Re: How can I report a new user?

2008-12-06 Thread Patricio Palma
On Sat, Dec 6, 2008 at 4:59 PM, Jeff FW <[EMAIL PROTECTED]> wrote: > > Do you mean when a user is added via the admin interface, or when a > user registers on the site through a view you have set up? If it's > through a view you've made, then just add the call to send_mail() in > the view. For

Re: using settings in templates

2008-12-06 Thread Jeff FW
You can pass the settings object into your context when you render your template, or you can write a context processor that adds the settings object to the template's context. Take a look at the docs on context processors, especially the section about writing your own:

Re: Character encoding... latin1 to utf8?

2008-12-06 Thread Rob Hudson
Wow, thanks so much Karen, for slicing and dicing the problem like that. On Dec 6, 10:36 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > You could also just convert the character set used on the MySQL side: > > http://dev.mysql.com/doc/refman/5.0/en/charset-conversion.html > > Presumably since

Re: How can I report a new user?

2008-12-06 Thread Jeff FW
Do you mean when a user is added via the admin interface, or when a user registers on the site through a view you have set up? If it's through a view you've made, then just add the call to send_mail() in the view. For the admin site, you'll want to look at signals:

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 11:53 AM, Marek Wawrzyczek <[EMAIL PROTECTED]>wrote: > In the tutorial (http://docs.djangoproject.com/en/dev/intro/tutorial01/) I > do everything what is written, and in the > "Activating Models" section, when I run the: > > python manage.py sql polls > > I get the

Re: Character encoding... latin1 to utf8?

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 1:36 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > > You can see how this works better than the latin1 code in a Python shell: > > >>> x = 'Bullet ->\x95<- and curly apostrophe ->\x92<- in a cp1252 > bytestring' > >>> ulatin1 = x.decode('latin1') > >>> ulatin1 > u'Bullet

using settings in templates

2008-12-06 Thread barracuda
Hello, How can I use a configuration in settings in templates? For e.g , I would like to use the DATE_FORMAT configured in settings to format the database datetime in a template Here: {{db_time|date:"D d M Y" }} I want to get the format from settings. Thanks!

How can I report a new user?

2008-12-06 Thread Patricio Palma
I have a model user class User(models.Model): name = models.CharField(_("name"), max_length=40) paternals = models.CharField(max_length=40) maternals = models.CharField(max_length=40) email = models.EmailField("e-mail") phone = models.IntegerField(_("phone number")) rol =

Re: Character encoding... latin1 to utf8?

2008-12-06 Thread Karen Tracey
On Sat, Dec 6, 2008 at 11:10 AM, Rob Hudson <[EMAIL PROTECTED]> wrote: > [snip debug info] > > Now instead of \x95 I get \u2022 (which is a bullet). > > From here I'm not sure what the best way to proceed is... do I want > the \u2022 version instead, in which case, should I not pass in >

Excel Generating Report

2008-12-06 Thread garces.85
Hello, I need some urgent help. I have a function that generates a report in excel, the report returns the data that i need the problem es that i am getting some strange characters like: Í , ó, ñ, etc... I have tried with django smart_unicode and force_unicode but nothing happens. Is there i

Re: Google Friend Connect and Django

2008-12-06 Thread Eugene Lazutkin
I did: http://lazutkin.com/blog/2008/dec/4/trying-google-friend-connect/ Being a client-side technology (adding two static HTML files do not count) it is largely irrelevant of Django or any other server-side framework. But I did you Django to style one of the static pages (the canvas) using

Re: transactions and locking in postgreSQL

2008-12-06 Thread msoulier
On Dec 5, 10:43 pm, Jeffrey Straszheim <[EMAIL PROTECTED]> wrote: > I took a quick glance at transaction.py (where the TransactionMiddleware > class is defined), and it appears you are correct. However, it should > be pretty easy to roll your own transaction class that skips the > is_dirty

models.URLField Restricting domain names

2008-12-06 Thread eldonp2
I have a models.URLField in one of my models. This is not allowing me to save domains that end in .co.za in the field. Is there a way to overwrite this behaviour? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Marek Wawrzyczek
In the tutorial (http://docs.djangoproject.com/en/dev/intro/tutorial01/) I do everything what is written, and in the "Activating Models" section, when I run the: python manage.py sql polls I get the following message: Traceback (most recent call last): File "manage.py", line 11, in

Re: Can't edit reverse relation in a many2many field in admin site

2008-12-06 Thread Nelson Altimari
Thank you so very much!! It worked exactly like I wanted. I had been through the django tickets, but since this ticket has no keywords, I wasn't able to find it... It's sad to see that this is being going on for nearly 3 years!!! In my case, I had my tables 'syncdb'ed already, so it was not an

How to extend django.contrib auth and admin.

2008-12-06 Thread Mahesh Vaidya
How to extend django.contrib auth and admin. Hi, I would like to extend "auth.user" from django.contrib auth and admin. I would like to add one more field in user. models.py (added Code) from django.contrib.auth import models as auth_models gender = ( ('M', 'Male'),

Re: Character encoding... latin1 to utf8?

2008-12-06 Thread Rob Hudson
Thanks Malcolm, On Dec 4, 6:12 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Now you might well be able to have this happen automatically using the > "unicode" option to MySQLdb -- it knows how to convert between various > server-side encodings and Python unicode. So look at that parameter

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Marek Wawrzyczek
On the page http://www.juiceanalytics.com/openjuice/django_settings_module/I've found a script and after I run the script then it worked. Regards 2008/12/6 Marek Wawrzyczek <[EMAIL PROTECTED]> > I've created a django application, and after that I get the same error. > Before I read Your post i

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Brett Parker
On 06 Dec 16:00, Marek Wawrzyczek wrote: > I've created a django application, and after that I get the same error. > Before I read Your post i switched to Ubuntu (and I'm still using it) to > check if the problem wasn't the operating system but on Ubuntu I get the > same error. How can I set this

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Marek Wawrzyczek
I've created a django application, and after that I get the same error. Before I read Your post i switched to Ubuntu (and I'm still using it) to check if the problem wasn't the operating system but on Ubuntu I get the same error. How can I set this path, and where are stored django.db modules

Re: Ruby on Rails vs Django

2008-12-06 Thread bruno desthuilliers
On 6 déc, 10:55, "Guillermo C." <[EMAIL PROTECTED]> wrote: > Hi. > > - Scaffolding: I prefer it over django admin in many situations. I > mean, when you're doing something complex you'll need to drop out the > django admin and write your own code, so it's cool to have the basic > CRUD code and

Question on Models: ImageField API

2008-12-06 Thread I.A
Hi, I'm writing an application that recieves a file from an outside source (not through a view though) which is written to the tmp directory and then writing it into the db through the FileField. Obviously the file must also be written to a path which can be retrieved later by just calling .path

Re: Ruby on Rails vs Django

2008-12-06 Thread bruno desthuilliers
On 5 déc, 23:57, yejun <[EMAIL PROTECTED]> wrote: > On Dec 5, 2:43 pm, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > > On 5 déc, 16:16, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > Metaphorically that Python/Djangois for a conservative engineer > > > mindset, > > > ??? care

get_or_create and foreign keys

2008-12-06 Thread felix
this is not the issue previously posted by somebody else. I think I found a bug with Manager get_or_create and foreign key fields when specifying with foreigntable__id class ObjectPermission(models.Model): permission = models.CharField(blank=False, max_length=20) user =

Google Friend Connect and Django

2008-12-06 Thread Pythoni
Has anyone used Google Friend Connect successfully with Django? (I do not know where I should upload the two required files).Can anyone help,please? Thanks L. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Django configuration. I can't import django.db .

2008-12-06 Thread Roland van Laar
marekw2143 wrote: > Hi > > I've installed python 2.5.2 into D:\P25 folder. > Then i installed diango using python setup.py install. > After that, when i typed: > > import django > > everything was ok, but when i type: > > import diango.db > > i get the

Django configuration. I can't import django.db .

2008-12-06 Thread marekw2143
Hi I've installed python 2.5.2 into D:\P25 folder. Then i installed diango using python setup.py install. After that, when i typed: >>> import django everything was ok, but when i type: >>> import diango.db i get the following message: Traceback (most recent call last): File "", line 1,

Re: order_with_respect_to fail any workaround ?

2008-12-06 Thread Thierry Stiegler
Juste for precision I use the trunk. On Dec 6, 9:34 am, Thierry Stiegler <[EMAIL PROTECTED]> wrote: > Hello, > > I got some errors by using the Meta options order_with_respect_to: > > class Category(PublicationBase, LocalisationBase): >     ITEM_PER_PAGE = 12 >     name =

multiwidget and inlineformset

2008-12-06 Thread Petry
hi all! I have a problem with in MultiWidget in inline forms. I created a widget [1] to separate the phone and code, on a normal form works fine, but when using a inlineformset use widget does not work right [1] http://dpaste.com/96511/ --~--~-~--~~~---~--~~

Re: Ruby on Rails vs Django

2008-12-06 Thread Guillermo C.
Hi. - Scaffolding: I prefer it over django admin in many situations. I mean, when you're doing something complex you'll need to drop out the django admin and write your own code, so it's cool to have the basic CRUD code and develop from that. - Database ORM: Both orm (rail's ActiveRecord and

order_with_respect_to fail any workaround ?

2008-12-06 Thread Thierry Stiegler
Hello, I got some errors by using the Meta options order_with_respect_to: class Category(PublicationBase, LocalisationBase): ITEM_PER_PAGE = 12 name = models.CharField(max_length=255) pictogram = models.ImageField(upload_to="categories", blank=True) old_id =

How does django handle uploads?

2008-12-06 Thread redbaron
Trying to figure out how does django handle uploads with wsgi. My main question is about handling errors, there is no .read() operations neither in http/multiparser.py nor in uploadhandler.py wrapped in try- except. All multipart-related infrastructure relies on checking about

Re: login problem

2008-12-06 Thread Ronny Haryanto
On Sat, Dec 6, 2008 at 2:42 PM, vierda <[EMAIL PROTECTED]> wrote: > today I try to make login page with follow example code in > djangoproject (user authentication chapter), code as following below : > > def my_view(request): > username = request.POST['username'] > password =