I am doing the tutorial part 1 and i got this error

2009-01-19 Thread jazz
c:\projects\mysite>python manage.py sql polls Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "C:\Python25\Lib\site-packages\django\core\management \__init__.py", line 340, in execute_manager utility.execute() File

Re: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread Eric Abrahamsen
On Jan 19, 2009, at 4:17 PM, jazz wrote: > > c:\projects\mysite>python manage.py sql polls > Traceback (most recent call last): > File "manage.py", line 11, in >execute_manager(settings) > File "C:\Python25\Lib\site-packages\django\core\management > \__init__.py", line 340, in

Re: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread joti chand
Thanks mate On Mon, Jan 19, 2009 at 9:26 PM, Eric Abrahamsen wrote: > > > On Jan 19, 2009, at 4:17 PM, jazz wrote: > >> >> c:\projects\mysite>python manage.py sql polls >> Traceback (most recent call last): >> File "manage.py", line 11, in >>execute_manager(settings) >>

Re: what to use for search facility

2009-01-19 Thread Konstantin
On Jan 19, 10:29 am, krylatij wrote: > Sphinx > Here > sampleshttp://softwaremaniacs.org/blog/2007/11/04/sphinx-search-in-cicero/ > (but in Russian) Thank you very much! I'll have a look (Being native Russian I'll have no problem reading this text :) )

What am i doing here

2009-01-19 Thread joti chand
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from mysite.polls.models import Poll, Choice Traceback (most recent call last): File "", line 1, in ImportError: No module named

Re: FileBrowser: Easy access to generated images from the template?

2009-01-19 Thread patrickk
you could either use a templatetag or a custom-method. that said, we are just working on integrating this with the filebrowse- field. so, if you wait a couple of days it´ll be there. here´s more information: http://code.google.com/p/django-filebrowser/issues/detail?id=63 patrick. On Jan 18,

NameError: global name ‘datetime’ is not defined

2009-01-19 Thread jazz
p.was_published_today() Traceback (most recent call last): File "", line 1, in File "c:\projects\mysite..\mysite\polls \models.py", line 11, in was_published_today return self.pub_date.date () == datetime.date.today() NameError: global name 'datetime' is not defined any help

Re: NameError: global name ‘datetime’ is not defined

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 01:31 -0800, jazz wrote: > p.was_published_today() Traceback (most recent call last): > File "", line 1, in File "c:\projects\mysite..\mysite\polls > \models.py", line 11, in was_published_today return self.pub_date.date > () == datetime.date.today() NameError: global name

Re: NameError: global name ‘datetime’ is not defined

2009-01-19 Thread Kenneth Gonsalves
On Monday 19 Jan 2009 3:01:29 pm jazz wrote: > p.was_published_today() Traceback (most recent call last): > File "", line 1, in File "c:\projects\mysite..\mysite\polls > \models.py", line 11, in was_published_today return self.pub_date.date > () == datetime.date.today() NameError: global name

building a blog site

2009-01-19 Thread joti chand
anyone knows is there any blog site development example in django --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: building a blog site

2009-01-19 Thread Muslu Yüksektepe
i am preparing a blog site. check out www.yuksektepe.com i will add how can make blog as soon as thank you from Turkiye 2009/1/19 joti chand > > anyone knows is there any blog site development example in django > > > > --~--~-~--~~~---~--~~

Re: What am i doing here

2009-01-19 Thread Dj Gilcrease
On Mon, Jan 19, 2009 at 1:55 AM, joti chand wrote: > > Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] > on > win32 > Type "help", "copyright", "credits" or "license" for more information. from mysite.polls.models import Poll, Choice >

Re: building a blog site

2009-01-19 Thread Dj Gilcrease
On Mon, Jan 19, 2009 at 2:58 AM, joti chand wrote: > > anyone knows is there any blog site development example in django There are lots and lots of blog apps for django http://getbanjo.com/ http://code.google.com/p/django-basic-apps/ http://byteflow.su/

Re: FileBrowser: Easy access to generated images from the template?

2009-01-19 Thread Benjamin Buch
Thank you! I guess I'll wait... Benjamin Am 19.01.2009 um 10:30 schrieb patrickk: > > you could either use a templatetag or a custom-method. > > that said, we are just working on integrating this with the > filebrowse- > field. so, if you wait a couple of days it´ll be there. > > here´s

Re: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread Herson
More attention, python is case sensitive. model is different of Model. 2009/1/19, joti chand : > > Thanks mate > > > On Mon, Jan 19, 2009 at 9:26 PM, Eric Abrahamsen wrote: > > > > > > On Jan 19, 2009, at 4:17 PM, jazz wrote: > > > >> > >>

Re: Possible to see sql for queryset before database gets it?

2009-01-19 Thread phoebebright
Thanks for those tips. Great help. On Jan 19, 12:37 am, Malcolm Tredinnick wrote: > On Sun, 2009-01-18 at 17:46 -0200, Ramiro Morales wrote: > > [] > > > > > or if you are using a recent trunk version (more recent than two weeks or > > so) > > you might want to

Odd problem with date based generic views

2009-01-19 Thread phoebebright
Generic view - year_archive, is not working for me. There are no errors displayed and no data either. On investigation, there seems to be a mysql error that is causing the problem and it could be related to the my using a view instead of a table as the source for the mode. The original date

Geraldo - reports engine

2009-01-19 Thread Marinho Brandao
Hi folks, I am working in a reports engine, with name "Geraldo". It is working well and I will finish the missing things for a first version tonight or tomorrows night. Its repository is here: - http://github.com/marinho/django-geraldo/ For a while it is generating only PDF, is a ReportLab

Re: Odd problem with date based generic views

2009-01-19 Thread phoebebright
Just going to transfer the view into a real table. Will let you know if that doesn't solve the problem! On Jan 19, 12:57 pm, Malcolm Tredinnick wrote: > On Mon, 2009-01-19 at 04:38 -0800, phoebebright wrote: > > Generic view - year_archive, is not working for me.  

Re: Odd problem with date based generic views

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 04:38 -0800, phoebebright wrote: > Generic view - year_archive, is not working for me. There are no > errors displayed and no data either. On investigation, there seems to > be a mysql error that is causing the problem and it could be related > to the my using a view

'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Thiago F. Crepaldi
Hello, I am migrating a system from django 0.97 (svn) to 1.0.2 (stable) and I got the following error when a [database] SEARCH FORM is submitted : 'RelatedObject' object has no attribute 'unique' I recreated all tables through 'python manage.db syncdb' command and imported all the old data back

'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Thiago F. Crepaldi
Hello, I am migrating a system from django 0.97 (svn) to 1.0.2 (stable) and I got the following error when a [database] SEARCH FORM is submitted : 'RelatedObject' object has no attribute 'unique' I recreated all tables through 'python manage.db syncdb' command and imported all the old data back

the inline form is not effect

2009-01-19 Thread friskyrain
I want to deal the m2m relationship in django admin site.I customized the inline class,modified the form and formset .But nothing is changed,and no mistake happen. I see the django website release notes,which said has fixed inline form bug.I do know how to do . this is my model.py #coding=utf-8

Comparing BoundField values in templates

2009-01-19 Thread ekellner
Hi, I am having trouble working with a BoundField value in a template. What I have is a IntergerField that is represented by a set of Radio Buttons in html. I want to lay out these buttons myself, and plus there's javascript involved. I don't believe there's a way to do this while letting the

Re: what to use for search facility

2009-01-19 Thread Tom Dyson
For non-Russian speakers, see http://code.google.com/p/django-sphinx/ I've used the Postgres + tsearch approach, with something like this for Django integration: http://smelaatifi.blogspot.com/2007/09/full-text-search-with-tsearch2-and.html On Jan 19, 8:49 am, Konstantin

Re: Blueprint css versus YUI grids versus ?

2009-01-19 Thread bruno desthuilliers
On 17 jan, 22:03, ydjango wrote: > has anyone used Blue Print css? Yes. Tried it for a personal project, found it nice at first - and to be true, it really helped me prototyping. But now the design is ok to me, I'm in the process of rewriting all my markup and css to get

Re: 'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 7:50 AM, Thiago F. Crepaldi wrote: > > Hello, > > I am migrating a system from django 0.97 (svn) to 1.0.2 (stable) and I > got the following error when a [database] SEARCH FORM is submitted : > 'RelatedObject' object has no attribute 'unique' > > I

Re: Blueprint css versus YUI grids versus ?

2009-01-19 Thread felix
I've also enjoyed blueprint for its clarity and speed. ideally I would love to assign more semantic .classes and #ids and then use a style sheet that assigns to styles to styles (yo dawg ... ) .detail { {% blueprint 'span-8' %} {% blueprint 'box' %} border: 1px solid {{ui.bordercolor}}; }

AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf
In my settings file I've set AUTH_PROFILE_MODULE = "myproject.myprofiles" Looking at my database, I've something called "registration_registrationprofile" I've defined myproject.myprofiles in models.py and the file clearly exists. Instead though "registration_registrationprofile" is the file

Re: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf
I'm rewording my question for clarification. * Where is the model file for "registration_registrationprofile" ? _If I go to ...site-packages/registration where I would assume the models.py file would contain the definition for this table, it does not exist there. * Why does the

Re: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf
OK. Please correct me if I'm wrong The "registration_registrationprofile" is simply a reference table created during the process of creating an inactive account. * If that is the case then how do I simply create a related record to users in "myproject.myprofiles" as set in settings.py as

accessing raw form data

2009-01-19 Thread Dennis Schmidt
Hello, After calling the clean() method of a form the whole cleaned_data ditionary is returned. But when the clean() method raises an error, the dictionary is emptied it seems since raising an error can't as well return any values of course. My problem now is, that I do need to access these

Re: accessing raw form data

2009-01-19 Thread Dennis Schmidt
OK, I just found it myself. The dictionary I was looking for is just called data. On 19 Jan., 16:45, Dennis Schmidt wrote: > Hello, > > After calling the clean() method of a form the whole cleaned_data > ditionary is returned. But when the clean() method raises an

FileBrowser and TinyMCE

2009-01-19 Thread martyn
Hi, I'm trying to get TinyMCE working with django-filebrowser. I started to make Tiny working : # === settings.py : INSTALLED_APPS = ( #... 'tinymce', 'filebrowser', #... ) TINYMCE_JS_URL = MEDIA_URL + 'js/tiny_mce/tiny_mce_src.js' URL_TINYMCE = TINYMCE_JS_URL

django_extensions and AutoSlugField

2009-01-19 Thread Dan Jewett
Maybe I'm just implementing this incorrectly, but if anyone is using this extension maybe you could shed some light on this error. When I try to add or save my Model I get: AttributeError: 'str' object has no attribute 'creation_counter' Here's what I think is relevant. in models.py: (partial)

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread Aaron Lee
So I guess S3Storage doesn't work with ImageField? Can anyone confirm that? -Aaron On Thu, Jan 15, 2009 at 10:30 AM, Aaron wrote: > > ping? > > On Jan 12, 9:53 am, "Aaron Lee" wrote: > > Hi all and David, > > > > I followed

Suspicious Operation/ filestorage problem

2009-01-19 Thread bax...@gretschpages.com
My SiteUser model allows an avatar upload. If there's not one, it assigns a default image on save: def save(self, *args, **kwargs): ... if self.avatar is None: self.avatar = "img/avatars/default.gif" super(SiteUser, self).save(*args, **kwargs) Pretty straightforward.

Raw SQL parameters

2009-01-19 Thread Matias Surdi
Hi, I'm trying to run a sql query with parameters taken from a dict, here is the relevant part of the code: query = "select * from table where name='%(name)s'" parameters = {'name':'valueofname'} cursor = connection.cursor() data =

Re: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 10:17 AM, NoviceSortOf wrote: > > > OK. Please correct me if I'm wrong > > The "registration_registrationprofile" is simply a reference table > created during > the process of creating an inactive account. > This table is not coming from base Django.

Re: Blueprint css versus YUI grids versus ?

2009-01-19 Thread Rock
I have generated several static sites using Django aym-cms, blueprint.css and markdown. This worked so well that I created a django app that encapsulates blueprint.css so that I now have the ability to manipulate layouts dynamically. Next up is to hook up "pagelets" (i.e., django-chunks,

Re: django_extensions and AutoSlugField

2009-01-19 Thread Dan Jewett
On Jan 19, 11:03 am, Dan Jewett wrote: > Maybe I'm just implementing this incorrectly, but if anyone is using > this extension maybe you could shed some light on this error. > > When I try to add or save my Model I get: > AttributeError: 'str' object has no attribute

Re: 'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Thiago F. Crepaldi
hello Karen, below is the code required. I hope you can help me =) thanks in advance Thiago here is the FEATURE MODEL unique property # # Fields that should be unique together in the database. # unique_together = [("featureId", "pf", "intComponent", "db",

Re: Raw SQL parameters

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 11:49 AM, Matias Surdi wrote: > > Hi, > > > I'm trying to run a sql query with parameters taken from a dict, here is > the relevant part of the code: >query = "select * from table where name='%(name)s'" Remove the single quotes around

Re: Raw SQL parameters

2009-01-19 Thread Matias Surdi
Karen Tracey escribió: > On Mon, Jan 19, 2009 at 11:49 AM, Matias Surdi > wrote: > > > Hi, > > > I'm trying to run a sql query with parameters taken from a dict, here is > the relevant part of the code: >query =

Re: Raw SQL parameters

2009-01-19 Thread Ramiro Morales
On Mon, Jan 19, 2009 at 3:15 PM, Matias Surdi wrote: > > The curious thing here, is that the above query works perfect running it > directly through sqlite3. > >From what I have seen by reading DB backend source code, Django cursor's execute() method supports only the

Compare the fields of the same model

2009-01-19 Thread Costin Stroie
Hi! I have the following model: class MyModel(models.Model): maxwidth = models.IntegerField(Maximum width', default = '0') width = models.IntegerField('Width', default = '0') I need to perform a query similar to this: SELECT * FROM mymodel WHERE width > maxwidth; The result should be

Re: Raw SQL parameters

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 12:40 PM, Ramiro Morales wrote: > > On Mon, Jan 19, 2009 at 3:15 PM, Matias Surdi > wrote: > > > > The curious thing here, is that the above query works perfect running it > > directly through sqlite3. > > > > From what I have

Re: Raw SQL parameters

2009-01-19 Thread Ramiro Morales
On Mon, Jan 19, 2009 at 3:56 PM, Karen Tracey wrote: > > That's using MySQL as the DB, so perhaps it is backend-specific? So it seems. the MySQL and PostgreSQL backend seem to (still?) support it. But the Oracle crew removed it a while back:

post login redirects with ssl rverse proxy

2009-01-19 Thread chris
Hi Guys I've got an an internal site on a http://internal1 that we want to expose to the world using a apache reverse proxy running SSL i.e https://external.org We're using mod_proxy mod_proxy_html ProxyPass /external/ http://internal ProxyPassReverse / SetOutputFilter

views, templates, render and groups

2009-01-19 Thread garagefan
pretty vague title i know... Can I return a query set via foo.object.filter() where in filter i check a manytomany field in foo against the group field for a user? I guess a way to use a group as a permission? IE: An article that would normally appear with a ton of other articles, in a

Re: 'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 12:04 PM, Thiago F. Crepaldi wrote: > > hello Karen, > > below is the code required. I hope you can help me =) > In the future, please post code of that length/width to someplace like dpaste.com; email makes it quite hard to read given how it gets

Re: Raw SQL parameters

2009-01-19 Thread Matias Surdi
Karen Tracey escribió: > On Mon, Jan 19, 2009 at 12:40 PM, Ramiro Morales > wrote: > > > On Mon, Jan 19, 2009 at 3:15 PM, Matias Surdi > wrote: > > > > The curious thing here,

Re: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf
> It isn't at all clear to me from what you have posted what difficulty you > are having in using your own auth profile module.  I do not understand why > the presence of the django-registration table would be causing any trouble. > At any rate, since you are already using django-registration,

Re: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 2:10 PM, NoviceSortOf wrote: > > > It isn't at all clear to me from what you have posted what difficulty you > > are having in using your own auth profile module. I do not understand > why > > the presence of the django-registration table would be

Re: Suspicious Operation/ filestorage problem

2009-01-19 Thread Andy Mckay
> SuspiciousOperation: Attempted access to '/img/avatars/default.gif' > denied. If i remember, it's because there's a / at the beginning, you probably want a relative path. -- Andy McKay ClearWind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy

Re: 'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 1:54 PM, Karen Tracey wrote: > On Mon, Jan 19, 2009 at 12:04 PM, Thiago F. Crepaldi wrote: > >> >> hello Karen, >> >> below is the code required. I hope you can help me =) >> > > In the future, please post code of that length/width

POST sub dictionaries

2009-01-19 Thread Vinicius Mendes
Is there in django something like the PHP POST subarrays? For example, if i do this in my form: and submit it, i will have the following data structure in my PHP POST: $_POST = array( 'test' => array( 0 => 0, 1 => 1 ) ) In django, i think it can turn into:

Invalid block tag: "get_comment_count"

2009-01-19 Thread Florian Lindner
Hello, I'm trying to use the comment framework from Django 1.0.2. I've followed all the steps in http://docs.djangoproject.com/en/dev/ref/contrib/comments/ (added it to installed apps, added to urls.py and loaded in the template: {% load comments % }) but I get: TemplateSyntaxError at

Re: Raw SQL parameters

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 2:06 PM, Matias Surdi wrote: > Yes, maybe it's just a problem with sqlite, which is te backend I'm > using.I'll try with mysql later. > > Is this a bug? should it be reported as a ticket? > I see you opened ticket #10070, which is fine because I

Re: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf
> I'm feeling a bit dense here. What is it, exactly, that isn't working? > What have you done, what did you expect, and what happens instead? > AUTH_PROFILE_MODULE isn't fundamentally broken, so some specifics on what > isn't working for you would help someone to help you fix whatever it is that

ModelForm values.

2009-01-19 Thread tom.s.macken...@gmail.com
I want to create a form based on a model and inject data into it manually. See below for implementation. class Approval(models.Model): company = models.ForeignKey(Company) product = models.ForeignKey(Product) approval_type = models.ForeignKey(Approval_Type, help_text='How

Filter model and retrieve associated model/objects at same time

2009-01-19 Thread sico
Hi, I'm filtering a model on some criteria... and based on the resultset I want to retrieve associated related models (all one-to-one relationships) Whats the most efficient way to do this without resorting to custom SQL? this is the best I can come up with: obj1s =

Re: Filter model and retrieve associated model/objects at same time

2009-01-19 Thread sico
btw... using 0.96 here... On Jan 20, 9:27 am, sico wrote: > Hi, > > I'm filtering a model on some criteria... and based on the resultset I > want to retrieve associated related models (all one-to-one > relationships) > > Whats the most efficient way to do this without

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread creecode
Hello Aaron, I can confirm that it can work. I'm using it but I don't know enough to diagnose your problem. Have you created the userprofile "directory" in your S3 bucket? Have you added the following to your settings.py? DEFAULT_FILE_STORAGE = 'S3Storage.S3Storage' AWS_ACCESS_KEY_ID

Re: Invalid block tag: "get_comment_count"

2009-01-19 Thread Briel
Hi It's hard to say what's going wrong with the code you provided, but I can say a few things. Since you don't get an error from {% load comments %}, there should be no problems with the installation. However, you might not actually run the command in the template, it could be that you are

Re: Invalid block tag: "get_comment_count"

2009-01-19 Thread Florian Lindner
Am 19.01.2009 um 22:04 schrieb Briel: > It's hard to say what's going wrong with the code you provided, but I > can say a few things. Since you don't get an error from {% load > comments %}, there should be no problems with the installation. > However, you might not actually run the command in

Deployment of apps with 3rd party code

2009-01-19 Thread Peter Manis
Hello, What approaches have been popular for deploying projects and applications with 3rd party python modules (code usually found in site-packages). Should the packages always be installed when possible or is it acceptable within the community to have a "lib" directory within a application or

Re: 'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread bruno desthuilliers
On 19 jan, 18:04, "Thiago F. Crepaldi" wrote: Absolutely not an answer to your question, but... > below is the code required. I hope you can help me =) >

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread Merrick
I am using S3Storage with an imagefield successfully. It sounds like you have not specified the storage engine and keys etc... in settings.py as creecode pointed out. I recall testing that the directory will be created on the fly if it does not exist. On Jan 19, 12:40 pm, creecode

Re: POST sub dictionaries

2009-01-19 Thread Briel
You should really read the django docs: http://docs.djangoproject.com/en/dev/ref/request-response/ In your first case, the latter value will overwrite the first value, so: request.POST['test[]'] = 1 or POST = {'test[]': 1} In your second case, you will just have one value:

Re: Problems with (Model)ChoiceField and the like

2009-01-19 Thread James Smagala
I hacked my way through my problem this weekend, and I posted a snippet about it here. For anyone having problems with complex dynamic formsets, check check out Malcolm Tredinnick's blog: http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ And additionally, take a look at my

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread Aaron Lee
Yes and yes, here are my settings in settings.py # Storage Settings DEFAULT_FILE_STORAGE = 'libs.storages.S3Storage.S3Storage' AWS_ACCESS_KEY_ID='xxx' AWS_SECRET_ACCESS_KEY='xxx' AWS_STORAGE_BUCKET_NAME='userprofile' from S3 import CallingFormat AWS_CALLING_FORMAT=CallingFormat.SUBDOMAIN

Re: Invalid block tag: "get_comment_count"

2009-01-19 Thread Briel
You should try playing around with the tags, trying to load comments different places trying some of the other comment tags to see what happens ect. Also are you using the block tags? what block tags do you have where have you placed them in relation to your code? On 19 Jan., 22:16, Florian

Re: Raw SQL parameters

2009-01-19 Thread Matias Surdi
Karen Tracey escribió: > On Mon, Jan 19, 2009 at 2:06 PM, Matias Surdi > wrote: > > Yes, maybe it's just a problem with sqlite, which is te backend I'm > using.I'll try with mysql later. > > Is this a bug? should it be reported

Re: Deployment of apps with 3rd party code

2009-01-19 Thread Ariel Mauricio Nunez Gomez
> > What approaches have been popular for deploying projects and applications > with 3rd party python modules (code usually found in site-packages). Should > the packages always be installed when possible or is it acceptable within > the community to have a "lib" directory within a application or

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread creecode
Hey Aaron, I think part of your problem is that AWS_STORAGE_BUCKET_NAME is not properly specified. It think it needs to be something like my-bucket- name.s3.amazonaws.com. Based on your settings then you should find your images end up at http:my-bucket-name.s3.amazonaws.com/ userprofile/. You

Re: Django-OAuth Issue

2009-01-19 Thread David Larlet
Chris, It seems that oauth_token argument is missing from your response. Do you still have errors with your code? Do not hesitate to contact me directly if that's the case, I do not want to spam this mailing-list with custom apps support. Regards, David Le 14 janv. 09 à 05:49, Chris a

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread David Larlet
Le 19 janv. 09 à 22:53, Aaron Lee a écrit : > > But I am still getting the exception saying the backend doesn't > support absolute paths. > In django/db/models/fields/files.py line 52 _get_path > return self.storage.path(self.name) > > and my self.name is userprofile/cs1.jpg > > Any

Re: Filter model and retrieve associated model/objects at same time

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 12:27 -0800, sico wrote: [...] > I haven't checked but assuming this is going to execute 2 sql commands > for each row returned by the first query not good!! > Is there a way to tell django/python that I want to retrieve the > related data from the other 2 models before

Re: Raw SQL parameters

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 17:49 +0100, Matias Surdi wrote: > Hi, > > > I'm trying to run a sql query with parameters taken from a dict, here is > the relevant part of the code: > query = "select * from table where name='%(name)s'" > parameters = {'name':'valueofname'} > cursor

Re: Best practise for using settings in templates

2009-01-19 Thread Fergus
Or you can set up a custom template tag that returns settings values if you only want the settings on particular pages, and don't want to add boilerplate to each view, or have the overhead of a context processor. On Jan 18, 12:25 pm, phoebebright wrote: > Thanks -

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread Aaron Lee
Thanks David, but it seems awkward to call avatar.image.storage.url(str(avatar.image)) to retrieve the URL for an ImageField. Do you have a better way? -Aaron On Mon, Jan 19, 2009 at 4:02 PM, David Larlet wrote: > > > Le 19 janv. 09 à 22:53, Aaron Lee a écrit : > > > > But

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread David Larlet
Le 20 janv. 09 à 01:48, Aaron Lee a écrit : > Thanks David, but it seems awkward to call > > avatar.image.storage.url(str(avatar.image)) > > to retrieve the URL for an ImageField. > Do you have a better way? avatar.image.url should work (without parenthesis, that's a property). I propose to

Re: AUTH_PROFILE_MODULE confusion

2009-01-19 Thread creecode
Hello NoviceSortOf, You may want to check out this Django documentation < http://docs.djangoproject.com/en/dev/ref/settings/#auth-profile-module > and < http://docs.djangoproject.com/en/dev/topics/auth/ > on AUTH_PROFILE_MODULE which may clear up your confusion. Registration doesn't use

Composite Indexing

2009-01-19 Thread Andrew Fong
I'm using contrib.contenttypes and have added the following to my model: content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey() When examining the DB (I'm using MySQL), I find that content_type is indexed but

Re: Composite Indexing

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 16:55 -0800, Andrew Fong wrote: > I'm using contrib.contenttypes and have added the following to my > model: > > content_type = models.ForeignKey(ContentType) > object_id = models.PositiveIntegerField() > content_object = generic.GenericForeignKey() > > When examining the

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread creecode
I think you may be correct on that my tip was incorrect. Forget what I said! :-) Have you tried getting the url like avatar.image.url? I use a line like this in some of my code that uses S3Storage and it works. image_url = my_model_instance.image.url.replace ( ':80', '' ) On Jan 19, 4:01 pm,

Re: Suspicious Operation/ filestorage problem

2009-01-19 Thread bax...@gretschpages.com
On Jan 19, 1:42 pm, Andy Mckay wrote: > If i remember, it's because there's a / at the beginning, you probably   > want a relative path. OK, where's it picking up the / then? I've got: if self.avatar is None: self.avatar = "img/avatars/default.gif" No / there.

Can I get the request object into the django.contrib.auth.views.password_change view template?

2009-01-19 Thread Hans Fangohr
Dear all, a beginner's question: I have added these entries into a django project in the urls.py: (r'^accounts/password_change/$', django.contrib.auth.views.password_change), (r'^accounts/password_change_done/$', django.contrib.auth.views.password_change_done), and I have provided

Re: Can I get the request object into the django.contrib.auth.views.password_change view template?

2009-01-19 Thread Malcolm Tredinnick
On Tue, 2009-01-20 at 02:07 +, Hans Fangohr wrote: [...] > However, in the template files, I extend my base.html which makes use > of the request object (basically checking whether the request has as > authenticated used and changing the html depending on this). > > It appears that the

HttpResponseRedirect with https screws up Firefox?

2009-01-19 Thread csingley
I've got a Django project set up behind an Apache SSL listener on port 443. Unfortunately, this seems to break HTTP redirects. For example, I have one view like this: """ @login_required def home(request): return HttpResponseRedirect('/user/%s/' % request.user) """ When a user hits this

Re: proper way to use S3Storage and Django ImageField

2009-01-19 Thread Aaron Lee
Yes avatar.image.url works, thanks again. -Aaron On Mon, Jan 19, 2009 at 5:17 PM, creecode wrote: > > I think you may be correct on that my tip was incorrect. Forget what > I said! :-) > > Have you tried getting the url like avatar.image.url? I use a line > like this in

Re: HttpResponseRedirect with https screws up Firefox?

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 18:42 -0800, csingley wrote: > I've got a Django project set up behind an Apache SSL listener on port > 443. Unfortunately, this seems to break HTTP redirects. > > For example, I have one view like this: > """ > @login_required > def home(request): > return

model Admin inner class and admin.autodiscover()

2009-01-19 Thread Elyézer Mendes Rezende
Hi, I'm using django 1.0.2 final, and for a test I setted the admin site configuration in the urls.py and used the Admin inner class like this: class MyModel(...): ... class Admin(): pass And then my model is registered in the admin site. But I see that to use an admin.py file

Re: model Admin inner class and admin.autodiscover()

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 18:14 -0800, Elyézer Mendes Rezende wrote: > Hi, I'm using django 1.0.2 final, and for a test I setted the admin > site configuration in the urls.py and used the Admin inner class like > this: > > class MyModel(...): > ... > class Admin(): > pass > > And

Re: HttpResponseRedirect with https screws up Firefox?

2009-01-19 Thread csingley
On Jan 19, 9:05 pm, Malcolm Tredinnick wrote: > If the web server handling the Django requests is not the external web > server, but is proxied for by some other server (e.g. Apache facing the > outside world, passing off requests to a particular URL prefix to some >

Multiple images in form

2009-01-19 Thread DragonSlayre
Hi, I've seen some posts from a while back, but didn't find any real solution when searching to find out how to put multiple images (or any field for that matter) into a form (mainly a ModelForm) Basically what I want to have is a form that has a one to many relationship from a post to images,

Built-in Template Reference in Admin

2009-01-19 Thread Kerr
Hi all, I'm reading through the Django book online and am currently on chapter 10. http://djangobook.com/en/1.0/chapter10/ Near the end it mentions a built-in template reference available from the admin interface, which contains info for all tags and filters available for a given site. In

Re: HttpResponseRedirect with https screws up Firefox?

2009-01-19 Thread Malcolm Tredinnick
On Mon, 2009-01-19 at 19:47 -0800, csingley wrote: > > On Jan 19, 9:05 pm, Malcolm Tredinnick > wrote: [...] > > In that sort of situation, it is the responsibility of the external > > webserver to rewrite any outgoing URLs correctly for the external world. > > Thus,

Re: Built-in Template Reference in Admin

2009-01-19 Thread Karen Tracey
On Mon, Jan 19, 2009 at 11:46 PM, Kerr wrote: > > Hi all, I'm reading through the Django book online and am currently on > chapter 10. http://djangobook.com/en/1.0/chapter10/ > > Near the end it mentions a built-in template reference available from > the admin interface,

  1   2   >