Re: Django-utils @async decorator and gunicorn

2011-06-28 Thread Anton Pirker
Hi! On 06/27/2011 03:47 PM, Javier Guerra Giraldez wrote: On Mon, Jun 27, 2011 at 4:50 AM, Anton Pirker wrote: But when i run my django app under gunicorn and i call the function with the @async decorator nothing happens at all... are you running the queue consumer daemon? Ah! There is a qu

Re: admin problem

2011-06-28 Thread jaspreet kaur
@JP De Villiers Thanks, my problem has been solved :) > > -- 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 django-users+unsubscr..

Re: ModelAdmin, custom field: default value?

2011-06-28 Thread Marc Aymerich
On Mon, Jun 27, 2011 at 11:03 PM, momo2k wrote: > Hello, > > Is there a way to set dynamic default values for custom fields in the > admin? > > Description of the problem: > > # models.py > # there are two models > class Meal(models.Model): >    name = ... > >    def check_new_price(self, price):

Re: ModelAdmin, custom field: default value?

2011-06-28 Thread Marc Aymerich
On Tue, Jun 28, 2011 at 10:27 AM, Marc Aymerich wrote: > On Mon, Jun 27, 2011 at 11:03 PM, momo2k wrote: >> Hello, >> >> Is there a way to set dynamic default values for custom fields in the >> admin? >> >> Description of the problem: >> >> # models.py >> # there are two models >> class Meal(mode

Re: Call SQL function within Model

2011-06-28 Thread Martin J. Laubach
You probably want to use something like https://docs.djangoproject.com/en/1.3/ref/models/querysets/#extra to add custom sql expressions to your querysets. mjl -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discus

Re: giving download links

2011-06-28 Thread Herman Schistad
On Tue, Jun 28, 2011 at 05:20, raj wrote: > I allow a user to upload a file, how do I now allow them to download > this file? I looked at the "serving static files" thing in the > djangoproject, but they said it causes security flaws or something. > Can someone help me? I couldn't find good inform

Re: Social Networking basics? -Raj

2011-06-28 Thread Kenneth Gonsalves
On Mon, 2011-06-27 at 12:48 +0100, Cal Leeming [Simplicity Media Ltd] wrote: > I've made a few modifications, feel free to revert/modify to your > hearts > content. am travelling - will add my stuff when I reach home - but thanks, keep it coming. -- regards KG http://lawgon.livejournal.com Coimb

Re: ModelAdmin, custom field: default value?

2011-06-28 Thread momo2k
Thanks, working :) def __init__(self, *args, **kwargs): super(MealModelForm, self).__init__(*args, **kwargs) try: instance = kwargs['instance'] self.fields['price'].initial = instance.price() except (KeyError, AttributeError): pass -

Help

2011-06-28 Thread Smoltok41
Hey wats up Im a django newbie and im working on this small project so i need help on how to add an attachment form so that i can be uploading attachments. thanx -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Django views

2011-06-28 Thread sandeep kaur
Hello all, I want to include background images and gallery images to my django project and I am unable to do so.Images do not get displayed. please help me out -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Checking inputs based on a specified data type

2011-06-28 Thread Django user
Hi, I have a field in my database which contains data type as a text. Note: these data types will be used when filling up information. How to based my input in my specified data type as an Admin control? For example, i have a category of payment and i choose on another field is "numeric" as a

Re: Help

2011-06-28 Thread Anton Pirker
Hi! On 06/28/2011 08:15 AM, Smoltok41 wrote: Hey wats up Im a django newbie and im working on this small project so i need help on how to add an attachment form so that i can be uploading attachments. thanx I am sure here you find everything you need: https://docs.djangoproject.com/en/1.3/topi

Custom site model uses the wrong manager

2011-06-28 Thread briehan
We have a custom 'sites framework' implementation that basically consists of a Site model and SiteManager. For some reason, when running the app, the Site model uses the SiteManager from django.contrib.sites instead of our own. I did the following from within the app: from myapp.sites.models impo

Re: REMOTE_USER authentication to 'Admin'?

2011-06-28 Thread thiru
HI I just like to know how to login to the django admin using remote data (wherever it may be from) On Jun 28, 1:28 am, Jeff Blaine wrote: > Sorry, I have no knowledge of Oracle SSO, what it allows, how it works, etc. -- You received this message because you are subscribed to the Google Groups

Re: Django-utils @async decorator and gunicorn

2011-06-28 Thread Javier Guerra Giraldez
On Tue, Jun 28, 2011 at 2:53 AM, Anton Pirker wrote: > Ah! There is a queue consumer daemon! ;)  Thank's for this hint! just checked and the @async decorator doesn't use the queue/consumer facility also included. sorry for the wrong hint. what @async does is adding to a python-standard Queue ob

Re: Django views

2011-06-28 Thread Rodrigo Gomes
Hi, Did you try to do what the docs said about static files? https://docs.djangoproject.com/en/dev/howto/static-files/ On Tue, Jun 28, 2011 at 5:17 AM, sandeep kaur wrote: > Hello all, > I want to include background images and gallery images to my django project > and I am unable to do so.Imag

widgets js

2011-06-28 Thread Alex Kutsan
I am try to do litle widget class My_widjet(forms.widgets.TextInput): class Media: js = ( 'js/my_calendar/cal.js', ) def render(self, name, value, attrs=None): to_return = u""" %s """ %self.media

Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Cal Leeming [Simplicity Media Ltd]
So, today I was confused why on earth dividing two ints (which leaves a remainder), didn't return back an int. In the end, I re-casted the ints as floats, performed the division, and this worked fine. Looked through the docs, and found this: http://docs.python.org/library/stdtypes.html *"For (pl

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Tom Evans
On Tue, Jun 28, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd] wrote: > So, today I was confused why on earth dividing two ints (which leaves a > remainder), didn't return back an int. > In the end, I re-casted the ints as floats, performed the division, and this > worked fine. > Looked throu

Re: Custom site model uses the wrong manager

2011-06-28 Thread Briehan Lombaard
It seems to be using the Site model (and therefore the SiteManager) from django.contrib.sites even though dhango.contrib.sites is _not_ included in my INSTALLED_APPS setting and I'm explicitly importing myapp.sites.models.Site. -- You received this message because you are subscribed to the Goo

E-store

2011-06-28 Thread lillian cauldwell
How does one set up an e-store on their d'jango website? Thanks, LSCauldwell -- "Creator" Cauldwell CEO, Passionate World Radio, Inc. Distinguish Yourself From the Ordinary! (c) 2010-2011 PWR http://www.internetvoicesradio.com http://www.amazingworldsoflscauldwell.com http://pwrwebtv.intuitwebsi

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Masklinn
On 2011-06-28, at 15:31 , Tom Evans wrote: > > Bit OT, but I'll bite (doesn't really relate to Django). Dividing two > ints ALWAYS returns an int. Unless you've switched to Python 3, or imported division from __future__ in which case true division is the default, and integer division is bumped to

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Tom Evans
On Tue, Jun 28, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd] wrote: > I'm wondering if it's better practise to always cast a number as a > float/decimal, rather than an int. > Any thoughts guys? > Cal > Damn, this was the bit I meant to comment upon - hard and fast rules are dangerous. Int

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Cal Leeming [Simplicity Media Ltd]
Yeah I'm aware of this now, but it was more of a "oh, didn't ever notice this before" rather than a "why is this happening" thread :) I was expecting that dividing two ints would return a float, but it doesn't. It does make sense, just a bit of a gotcha, you know? Cal On Tue, Jun 28, 2011 at 2:3

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Tom Evans
On Tue, Jun 28, 2011 at 2:36 PM, Masklinn wrote: > On 2011-06-28, at 15:31 , Tom Evans wrote: >> >> Bit OT, but I'll bite (doesn't really relate to Django). Dividing two >> ints ALWAYS returns an int. > Unless you've switched to Python 3, or imported division from __future__ in > which case true

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Cal Leeming [Simplicity Media Ltd]
Ah, I didn't know about importing division from __future__, so I may use this, thanks for letting me know! On Tue, Jun 28, 2011 at 2:36 PM, Masklinn wrote: > On 2011-06-28, at 15:31 , Tom Evans wrote: > > > > Bit OT, but I'll bite (doesn't really relate to Django). Dividing two > > ints ALWAYS r

Re: E-store

2011-06-28 Thread Anoop Thomas Mathew
You can find many django based store modules. The one i liked using was satchmo. Check out http://www.satchmoproject.com/ and more help about it here. https://bitbucket.org/chris1610/satchmo/wiki/Home regards, Anoop atm ___ Life is short, Live it hard. On 28 Ju

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Jun 28, 2011 at 2:37 PM, Tom Evans wrote: > On Tue, Jun 28, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd] > wrote: > > I'm wondering if it's better practise to always cast a number as a > > float/decimal, rather than an int. > > Any thoughts guys? > > Cal > > > > Damn, this was the

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Masklinn
On 2011-06-28, at 15:39 , Tom Evans wrote: > On Tue, Jun 28, 2011 at 2:36 PM, Masklinn wrote: >> On 2011-06-28, at 15:31 , Tom Evans wrote: >>> >>> Bit OT, but I'll bite (doesn't really relate to Django). Dividing two >>> ints ALWAYS returns an int. >> Unless you've switched to Python 3, or imp

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Tom Evans
On Tue, Jun 28, 2011 at 2:41 PM, Cal Leeming [Simplicity Media Ltd] wrote: > Yeah I have come up against horrible problems before when forcibly > re-casting all int's to float's.. (especially when it's in the monetary > sense). I had assumed that it would be a on a "per case" basis, but just > wan

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Jun 28, 2011 at 2:47 PM, Tom Evans wrote: > On Tue, Jun 28, 2011 at 2:41 PM, Cal Leeming [Simplicity Media Ltd] > wrote: > > Yeah I have come up against horrible problems before when forcibly > > re-casting all int's to float's.. (especially when it's in the monetary > > sense). I had as

Re: Curious int/float/division/math 'gotcha' in py (discussion)

2011-06-28 Thread william ratcliff
I've been trying django-money for this reason... On Jun 28, 2011 9:50 AM, "Cal Leeming [Simplicity Media Ltd]" < cal.leem...@simplicitymedialtd.co.uk> wrote: > On Tue, Jun 28, 2011 at 2:47 PM, Tom Evans wrote: > >> On Tue, Jun 28, 2011 at 2:41 PM, Cal Leeming [Simplicity Media Ltd] >> wrote: >> >

Re: REMOTE_USER authentication to 'Admin'?

2011-06-28 Thread Jeff Blaine
It's all right here: https://docs.djangoproject.com/en/1.3/howto/auth-remote-user/ and other details in the mailing list thread you are reading/posting to (this one!) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on

Re: Importing file to Models - Temporary store to allow confirming?

2011-06-28 Thread Shawn Milochik
On 06/28/2011 02:43 AM, Victor Hooi wrote: Shawn, Thanks for the quick reply =). If we go with the third approach, what advantages are there to persisting the models in MongoDB (or something similar like Redid.or Cassandra), as opposed to a traditional RDBMS? (I just want to get a good hand

Re: Sidebars

2011-06-28 Thread garagefan
This sounds like too much work, every time you want a new option in the sidebar you're adding another if, right? I'm planning on building a template tag to handle side content like that. I am using mezzanine as my base so i have the luxury of having every url resolve to their Page model. So i'm go

Re: Sidebars

2011-06-28 Thread Hutch
isn't this what block tags are for? or custom template tags? On Jun 28, 10:48 am, garagefan wrote: > This sounds like too much work, every time you want a new option in > the sidebar you're adding another if, right? > > I'm planning on building a template tag to handle side content like > that. I

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-28 Thread Cal Leeming [Simplicity Media Ltd]
Second call for anyone who wants to attend this webcast, 3 days left to place your vote. Cal On Fri, Jun 24, 2011 at 7:34 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Really glad to see there has been so much interest in this! > > If possible, can every

Re: Django-utils @async decorator and gunicorn

2011-06-28 Thread Anton Pirker
Hi! On 06/28/2011 02:45 PM, Javier Guerra Giraldez wrote: another thing I don't know about is gunicorn; but the 'g' in the name comes from 'green threads'. do you (or anybody else) know if that means that it patches the python thread implementation? if so, that could be interfering with the @a

admin search - lookup following GenericForeignKey

2011-06-28 Thread virtuallight
I have a model X with Y field which is GenericForeignKey field. In the model admin for model X I want to have something like: search_fields('Y__fieldname'). I get the error 'Cannot resolve keyword "X" into field' which makes sense since it's a virtual field and doesn't go to fields in X._meta Any

Re: Sidebars

2011-06-28 Thread Venkatraman S
Can be used chunks along with this approach. I would wait to see your template tag. On Tue, Jun 28, 2011 at 8:51 PM, Hutch wrote: > isn't this what block tags are for? or custom template tags? > > On Jun 28, 10:48 am, garagefan wrote: > > This sounds like too much work, every time you want a ne

Re: Custom site model uses the wrong manager

2011-06-28 Thread bruno desthuilliers
On Jun 28, 2:26 pm, briehan wrote: > We have a custom 'sites framework' implementation that basically > consists of a Site model and SiteManager. For some reason, when > running the app, the Site model uses the SiteManager from > django.contrib.sites instead of our own. > > I did the following fro

Re: Django views

2011-06-28 Thread Jagdeep Singh Malhi
On Jun 28, 1:17 pm, sandeep kaur wrote: > Hello all, > I want to include background images and gallery images to my django project > and I am unable to  do so.Images do not get displayed. please help me out You mean use image in Django templates ? -- You received this message because you are

Re: Custom site model uses the wrong manager

2011-06-28 Thread bruno desthuilliers
On Jun 28, 7:04 pm, bruno desthuilliers wrote: > Not enough info to be sure but looks like some sys.path order issue to > me. Forgot to mention that ./manage.py and (or ?) the dev server sometimes behave a bit strangely wrt/ imports, so depending on your code layout and how you declare your apps

Re: admin search - lookup following GenericForeignKey

2011-06-28 Thread Michal Petrucha
> I have a model X with Y field which is GenericForeignKey field. In the > model admin for model X I want to have something like: > search_fields('Y__fieldname'). I get the error 'Cannot resolve keyword > "X" into field' which makes sense since it's a virtual field and > doesn't go to fields in X._

Re: django 1.3 timing out on empty POST request

2011-06-28 Thread mehdi ait oufkir
Hello Roberto, it looks like upgrading to uWSGI 0.9.8.1 solved the issue. Thanks for your help! On Jun 27, 9:18 pm, Roberto De Ioris wrote: > Il giorno 27/giu/2011, alle ore 22.07, mehdi ait oufkir ha scritto: > > > Roberto, I'm actually using uWSGI 0.9.6.5. > > > Can you tell me what is the is

Global generic files? Best practice(s)?

2011-06-28 Thread Micky Hulse
Hello, I was going to start a "global" app for a generic "helpers.py" file; I plan on using this code in multiple apps. Question: Is creating a generic app a standard approach to storing "global" code? ... If the answer to the above question is "yes": What's your preferred approach to handling

Re: widgets js

2011-06-28 Thread Andres Pardini
Hi Can you can access to the javascript calendar code from browser?? -- 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 django-users

forms and form processing

2011-06-28 Thread jay K.
Hello, I need to add a form on my django website so far this is what i have: in my models.py: import statements not shown here CONTACT_OPTIONS = ( ('skype video anruf','Skype Video- Anruf'), ('skype anruf ','Skype Anruf'),

Comparing ManyToManyFields

2011-06-28 Thread Josh Lothian
So I'm working on my first Django application, and I've run into a stumbling block. In simplest terms, I've got two objects: def Package(models.Model): name=models.CharField(max_length=255) version=models.CharField(max_length=128) def Machine(models.Model): hostname=models.CharField(

let the users download files

2011-06-28 Thread pankaj sharma
hello friends , i have a database in which i have some files say photos... {i am uploading photos from django admin.} i want to make a template so that the users of my website can download these photos .. so can anyone provide me some useful information or any link -- You received this message be