Model overriding predefined model methods.

2011-10-08 Thread Petey
I'am writing a thumbnail generator for my Images model Everything is working fine apart from saving path to the database. http://wklej.to/AimKm Could you give me some hints on model overriding? -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Model overriding predefined model methods.

2011-10-08 Thread Adrian Merrall
Petey, Could you give me some hints on model overriding? > > Do you mean you want to override the default save method to put in some processing first? This is covered here https://docs.djangoproject.com/en/dev/topics/db/models/#overriding-predefined-model-methods If you are wanting to generate

Re: Model overriding predefined model methods.

2011-10-08 Thread Petey
Actually my code worked. Other code created some errors :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Zr4vh5PEW5YJ. To post to this group, send email t

Re: STATIC_ROOT confusion

2011-10-08 Thread Markus Gattol
if your STATICFILES_DIRS tuple contains '/a/b/static/img' then it will work if you put foo.jpg into /a/b/static/img/foo.jpg and have STATIC_URL = '/static/'. STATIC_ROOT doesn't have something to do with that, it's used to collect static stuff like CSS files from your apps etc. I think if people

Re: How to do equivalent of LEFT JOIN ON in Django (returning all Left rows, when Right item may not exist)

2011-10-08 Thread Michal Petrucha
On Thu, Oct 06, 2011 at 12:05:09PM -0700, Attempting Django wrote: > Hi guys, can anyone please give me an example of how to do equivalent > of a LEFT JOIN ON in Django?? I am trying to return every row from one > table on the left, with any matches in a foreign table on the right > (there will be

Re: STATIC_ROOT confusion

2011-10-08 Thread Markus Gattol
Here's what I think is semantically good distinction: PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) (that's the dir containing your settings.py, that dir is usually one dir below your virtualenv, I simply name it "pr". You can then use PROJECT_ROOT to reference such as: STATIC_RO

Signals and listeners defined in a separate modules unusable in other apps

2011-10-08 Thread Guruprasad L
Hi, I have a django project where I have defined some signals and listeners in a separate module (i.e., in a folder with __init__.py) in the files signals.py and listeners.py. These signals are to be used by multiple applications in the project. So I wrote the code connecting the signal to the l

Class Views Questions

2011-10-08 Thread CrabbyPete
I am fooling around with django generic class views, and I was wondering if its possible to actually build class views per item for example I have the following class view. class TeamView( View, TemplateResponseMixin ): template_name = 'team.html' def get(self, request): if 'team

Question about Signals and Bootstrap

2011-10-08 Thread Santiago Basulto
Hello people. I'm starting with django. Where can i find some doc that explains how Django is bootstraped and loaded. I'm looking for this becouse while i was reading the "Signals" chapter at django docs, i read that "In some circumstances, the module in which you are connecting signals may be imp

Re: STATIC_ROOT confusion

2011-10-08 Thread Xavier Ordoquy
Le 8 oct. 2011 à 15:27, Markus Gattol a écrit : > Here's what I think is semantically good distinction: > > PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) (that's the dir > containing your settings.py, that dir is usually one dir below your > virtualenv, I simply name it "pr". You

Re: Class Views Questions

2011-10-08 Thread Xavier Ordoquy
Le 8 oct. 2011 à 16:12, CrabbyPete a écrit : > I am fooling around with django generic class views, and I was > wondering if its possible to actually build class views per item for > example I have the following class view. > > > class TeamView( View, TemplateResponseMixin ): >template_name

Re: STATIC_ROOT confusion

2011-10-08 Thread Markus Gattol
> > > Your STATICFILES_DIRS should not be set to static. > Create a new theme directory, put your files there and update your > STATICFILES_DIRS. > Have a look at > http://www.linovia.com/blog/django-staticfiles-troubleshooting/ for an > example. > Yeah, read that post and I disagree. Introduc

Re: Class Views Questions

2011-10-08 Thread Flavia Missi
Hi, There's a mixin that does exactly what you're doing in your view, ProcessFormView; used by the generic view FormView. You should use it. ;) If you want to use the same view to delete an object you will probably have to change your dispatch method (defined at View class), there's no way to do

Re: STATIC_ROOT confusion

2011-10-08 Thread Xavier Ordoquy
Le 8 oct. 2011 à 17:23, Markus Gattol a écrit : > Yeah, read that post and I disagree. Introducing yet another name on the > filesystem (theme) certainly isn't helping people (this thread and many > others show there's enough confusion already). It makes more sense to have a > 1:1 mapping betw

PayPal Adaptive Payments

2011-10-08 Thread Ian
I've been looking at this: https://www.x.com/docs/DOC-3084 but I'm trying to set it up with Adaptive Payments. Basically, I need a payment to be split between a few users... so if I purchase something from seller A: seller A gets 90% person B gets 5% person C gets 5% This is easy to do with PayP

Re: PayPal Adaptive Payments

2011-10-08 Thread Shawn Milochik
Please read this: https://code.djangoproject.com/wiki/UsingTheMailingList Your question is so vague that it's gives the impression you haven't actually tried to solve your own problem and you want someone to do your work for you. Assuming that's not the case, please let us know what you've tried

Re: PayPal Adaptive Payments

2011-10-08 Thread Markus Gattol
Rather than reinventing the wheel take a look at https://github.com/agiliq/merchant It's possible to split one payment into 90,5,5 as you want, all you need to do is write a little logic atop merchant. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: How to do equivalent of LEFT JOIN ON in Django (returning all Left rows, when Right item may not exist)

2011-10-08 Thread Javier Guerra Giraldez
On Sat, Oct 8, 2011 at 8:18 AM, Michal Petrucha wrote: > Behind the scenes, Django does a JOIN. Its type (INNER od LEFT OUTER) > is decided based on whether the left-hand column (your ForeignKey > field) is allowed to be NULL or not. the weird part, is that is takes the same choice on reverse rel

TemplateSyntaxError at /admin/

2011-10-08 Thread Tempomental
Hello, I have recently launched my app into production, and am now getting 500 errors when I attempt to access any of the /admin pages from either the main site (mysite.com/admin), or any of the two apps inside my project (mysite.com/recipes/admin or mysite.com/tracker/admin). My admin pages were

Re: How to do equivalent of LEFT JOIN ON in Django (returning all Left rows, when Right item may not exist)

2011-10-08 Thread Sebastian Goll
On Sat, 8 Oct 2011 16:30:37 -0500 Javier Guerra Giraldez wrote: > On Sat, Oct 8, 2011 at 8:18 AM, Michal Petrucha > wrote: > > Behind the scenes, Django does a JOIN. Its type (INNER od LEFT OUTER) > > is decided based on whether the left-hand column (your ForeignKey > > field) is allowed to be

Re: TemplateSyntaxError at /admin/

2011-10-08 Thread Shawn Milochik
See your urlpatterns section that has the prefix 'myapp.views.' It's at the bottom of your e-mail. You have some stuff in there that doesn't belong there. It should be broken out into another "urlpatterns += patterns(...)" section that has no prefix or the correct prefix. -- You received this me

Re: TemplateSyntaxError at /admin/

2011-10-08 Thread Tempomental
That did it! Thanks =) On Oct 8, 4:49 pm, Shawn Milochik wrote: > See your urlpatterns section that has the prefix 'myapp.views.' It's at the > bottom of your e-mail. > > You have some stuff in there that doesn't belong there. It should be broken > out into another "urlpatterns += patterns(...)"

StackedLinein and 404 error

2011-10-08 Thread EdgarAllenPoe
Working on django tutorial here: https://docs.djangoproject.com/en/dev/intro/tutorial02/ and I am stuck where they start the instructions about Stackedlnline. I keep getting the following error: Page not found (404) Request Method: GET Request URL:http://127.0.0.1:8000/admin/polls/cho

StackedLinein and 404 error [SOLVED]

2011-10-08 Thread EdgarAllenPoe
There was nothing wrong with the code. I just needed to restart my server, and it worked like a charm On Oct 8, 11:15 pm, EdgarAllenPoe wrote: > Working on django tutorial > here:https://docs.djangoproject.com/en/dev/intro/tutorial02/ > and I am stuck where they start the instructions about St