Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Russell Keith-Magee
On Fri, Mar 15, 2013 at 11:58 AM, Mike Dewhirst wrote: > On 15/03/2013 10:31am, Russell Keith-Magee wrote: > >> >> >> On Fri, Mar 15, 2013 at 5:24 AM, Shawn Milochik > > wrote: >> >> I've repeatedly asked about this over the past couple of years and >> there seem

Re: resize modelform fields on template

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 4:25pm, Mike Dewhirst wrote: On 15/03/2013 11:05am, cabrazil wrote: Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: Hi all! I'd like to know if there's a way to resize my model

Re: resize modelform fields on template

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 11:05am, cabrazil wrote: Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: Hi all! I'd like to know if there's a way to resize my modelform fields on the template. They're bei

"condition_dict" and "get_cleaned_data_for_step" triggers multiple queries in FormWizard

2013-03-14 Thread Einsiedlerkrebs
Hi, I made a FormWizard with Django 1.4 according to the FormWizard-documentationwith *different templates for each form* and *Conditionally view*. It works, but I found a problem with the *Conditionally view*. The cond

Re: resize modelform fields on template

2013-03-14 Thread cabrazil
Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: > > Hi all! > I'd like to know if there's a way to resize my modelform fields on the > template. They're being rendered too big for the text input. > I

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 10:31am, Russell Keith-Magee wrote: On Fri, Mar 15, 2013 at 5:24 AM, Shawn Milochik mailto:sh...@milochik.com>> wrote: I've repeatedly asked about this over the past couple of years and there seems to be no "right" answer." This, to me, is the biggest flaw in Django.

Re: How to deal with No handlers could be found for logger "XXX"?

2013-03-14 Thread askpython
Thank you! 在 2013年3月14日星期四UTC+9上午11时58分23秒,jondbaker写道: > > This example in the django docs demonstrates how to configure logging > handlers within your settings.py: > https://docs.djangoproject.com/en/dev/topics/logging/#an-example > > On Wed, Mar 13, 2013 at 8:50 PM, > wrote: > >> As title,whe

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Russell Keith-Magee
On Fri, Mar 15, 2013 at 5:24 AM, Shawn Milochik wrote: > I've repeatedly asked about this over the past couple of years and > there seems to be no "right" answer." This, to me, is the biggest flaw > in Django. > There's definitely a right answer. > The official (and useless) answer is that you

Re: python

2013-03-14 Thread Russell Keith-Magee
On Thu, Mar 14, 2013 at 11:09 PM, Harjot Mann wrote: > hello everyone > > i have convert the python file to exe file using freeze > but the executable file is not working.. > when im running it as ./filename > it is giving me this error.. > > Traceback (most recent call last): > File "recta

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
On Thu, Mar 14, 2013 at 6:03 PM, Larry Martell wrote: > > I have been googing this for 2 days and trying lots of different > things, without success. I really appreciate your help - I've made > more progress in the last hour when in the previous 48. Glad I could help, but you really should searc

Re: Django static files STATIC_ROOT vs STATICFILES_FINDERS

2013-03-14 Thread Hartmut
I like this explanation very much, thank You. I didn't know, that STATICFILES_DIRS is the source for the DEV-server serving static files. That is a big help. Now, as a consequence, in my project I've renamed the empty static folder (where the collects go into) to "static_collected", that means:

Re: plugin for selecting files

2013-03-14 Thread Larry Martell
On Thu, Mar 14, 2013 at 4:44 PM, Shawn Milochik wrote: > You can certainly upload a file, then parse it or whatever. I'm just > saying you can't just grab a directory listing from the user. > > To upload multiple files, you may be able to just add "multiple" to > your file upload element. A quick

Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread lamen
Hi Mr. Terra, Thanks so much for these links and your help. Definitely appreciated. I know I'll just end up using the ModelSerializer class but I like to understand what is going on underneath to a reasonable level and it bugs me when I can't figure something that I know is basic out. On T

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
You can certainly upload a file, then parse it or whatever. I'm just saying you can't just grab a directory listing from the user. To upload multiple files, you may be able to just add "multiple" to your file upload element. A quick Google search found this: http://davidwalsh.name/multiple-file-up

Re: plugin for selecting files

2013-03-14 Thread Larry Martell
On Thu, Mar 14, 2013 at 4:27 PM, Shawn Milochik wrote: > On Thu, Mar 14, 2013 at 4:54 PM, Larry Martell > wrote: >> On Thu, Mar 14, 2013 at 3:43 PM, Shawn Milochik wrote: >>> If you have an HTML file input field in your template you get one >>> automatically from your browser. >> >> Thanks! Do

Django on Mediatemple DV (4.0) in Virtualenv

2013-03-14 Thread Tim Walzer
I am currently trying to install Django on a Mediatemple DV (4.0) server and have the installation be within a virtualenv. The django app will be run from a subdomain, *parts.domain.com*, while the root domain *domain.com* is serving a wordpress site. I have django installed inside the virtual

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
On Thu, Mar 14, 2013 at 4:54 PM, Larry Martell wrote: > On Thu, Mar 14, 2013 at 3:43 PM, Shawn Milochik wrote: >> If you have an HTML file input field in your template you get one >> automatically from your browser. > > Thanks! Do you know how to change the text displayed in the button? > It's di

Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread Andre Terra
This is a much better explanation on the use of *args and **keywordargs (**kwargs) http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/ On Thu, Mar 14, 2013 at 6:22 PM, Andre Terra wrote: > About the asterisks, please checkout this link: > > http://stackoverflow.com/ques

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Shawn Milochik
I've repeatedly asked about this over the past couple of years and there seems to be no "right" answer." This, to me, is the biggest flaw in Django. The official (and useless) answer is that you must pass "user" in everywhere you save anything. This is stupid, obviously, because you can not rewrit

Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread Andre Terra
About the asterisks, please checkout this link: http://stackoverflow.com/questions/4306574/python-method-function-arguments-starting-with-asterisk-and-dual-asterisk the difference between dict['key'] and dict.get('key', 'something') is that the second doesn't raise a KeyError exception when 'key'

What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread lamen
Hello, Not sure what the difference is in the usage of attrs I could not find the documentation for this although I'm sure it's going to be obvious after the fact. Also, could someone tell me what the double asterisks mean in the line return Comment(**attrs) ? Is this some type of variable len

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Hendrik Speidel
Hi, Accessing the request within models may be problematic ... E.g. when using a management command, there is no request. However, it's doable: -implement a middleware that takes the request or request.user and stores it in a thread local -register this middleware in your settings -in your mod

Re: Problems install/download Django 1.5

2013-03-14 Thread Shawn Milochik
On Thu, Mar 14, 2013 at 3:51 PM, wrote: > Sorry can't find a message from you in this newsgroup with any virtualinv > instructions. > https://groups.google.com/d/msg/django-users/aRfuUHY21CU/L9UukI7CmxoJ -- You received this message because you are subscribed to the Google Groups "Django use

Re: plugin for selecting files

2013-03-14 Thread Larry Martell
On Thu, Mar 14, 2013 at 3:43 PM, Shawn Milochik wrote: > If you have an HTML file input field in your template you get one > automatically from your browser. Thanks! Do you know how to change the text displayed in the button? It's displaying 'Choose File' and I want it to have something else. Als

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
If you have an HTML file input field in your template you get one automatically from your browser. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+u

Re: plugin for selecting files

2013-03-14 Thread Larry Martell
On Wed, Mar 13, 2013 at 6:09 PM, Larry Martell wrote: > Anyone know of a good plugin or javascript/jQuery package that I can > use for a dialog box for navigating and selecting files (just like > when you select "Open File ..." for example)? I didn't get any replies, so maybe I didn't ask my ques

FieldError with ManyToMany relationship in ModelAdmin list_display item when server is not in DEBUG mode

2013-03-14 Thread Eric Bass
I can not for the life of me figure out why my list_display works when the django server is in DEBUG=True but not when it is in DEBUG=False. I am using Django 1.4.3 (mod_wsgi 3.4/Python 2.7) Here is the partial stack trace... File "/home/difuzi0n/webapps/wedding/lib/python2.7/django/db/m

Re: Problems install/download Django 1.5

2013-03-14 Thread Lachlan Musicman
On 15 March 2013 06:51, wrote: > Sorry can't find a message from you in this newsgroup with any virtualinv > instructions. > > Or do you mean this link?: > https://pypi.python.org/pypi/virtualenv > > This text _is_ detailed with regard to virtualenv, but the combination with > apache/wsgi on debi

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Jonathan D. Baker
Perhaps a combination of signals and receivers would fit the bill? Models.py shouldn't be concerned with request objects. Sent from my iPhone On Mar 14, 2013, at 12:59 PM, Simon Chan wrote: > Essentially, I'm just trying to make a simple email alert system. If anyone > creates, modifies or de

Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Simon Chan
Essentially, I'm just trying to make a simple email alert system. If anyone creates, modifies or deletes an entry in the admin back end, I'll receive an email as to which user did what to which model. I already figured out how to detect the 3 user actions mentioned above in the models.py as well

Re: Problems install/download Django 1.5

2013-03-14 Thread breg
Sorry can't find a message from you in this newsgroup with any virtualinv instructions. Or do you mean this link?: https://pypi.python.org/pypi/virtualenv This text _is_ detailed with regard to virtualenv, but the combination with apache/wsgi on debian would pose more questions. Apart from my

Using django-devserver with Werzbeug to debug an app - interactive debugger not being trigged?

2013-03-14 Thread Victor Hooi
Hi, I'm trying to use django-devserver (https://github.com/dcramer/django-devserver) to debug localshop (https://github.com/mvantellingen/localshop), a Django-based Pypi server. I've installed django-devserver and werzbeug. I then added 'devserver' to INSTALLED_APPS, and have started it up: (

python

2013-03-14 Thread Harjot Mann
hello everyone i have convert the python file to exe file using freeze but the executable file is not working.. when im running it as ./filename it is giving me this error.. Traceback (most recent call last): File "rectangle.py", line 2, in from gasp import * File "/usr/lib/pymod

Re: django / django cms + responsive

2013-03-14 Thread Anurag Chourasia
Look at 1. Twitter Bootstrap. http://twitter.github.com/bootstrap/ 2. Foundation Zurb. http://foundation.zurb.com/ Regards, Anurag On Mar 14, 2013 7:03 AM, "Frank Bieniek" wrote: > Hi Guys, > what are your preferred apps to turn django or django cms into a > responsive website? > > What are yo

Re: [ANN] Introducing Brillixy - Django admin skin & customization kit

2013-03-14 Thread Derek
On Tuesday, 12 March 2013 17:58:22 UTC+2, rudyryk wrote: > > Hello everyone! > > Today we've released alpha of Brillixy https://github.com/05bit/brillixy. > > This is a Django admin skin with some extras. Actually it's an > alternative to Grapelli, Admin Tools and other apps that changes > stan

Re: Profiling django apps using Python 3? No hotspot module.

2013-03-14 Thread Thomas Weholt
Thanks a bunch :-) Got it working in python 3 with minor tweaking. Thomas On Thu, Mar 14, 2013 at 3:09 PM, Shawn Milochik wrote: > I use this and it's great. I haven't tried it with Python 3, but it's > all standard library stuff. > > I tweaked mine a bit so it dumps the profile files to my temp

Re: Profiling django apps using Python 3? No hotspot module.

2013-03-14 Thread Shawn Milochik
I use this and it's great. I haven't tried it with Python 3, but it's all standard library stuff. I tweaked mine a bit so it dumps the profile files to my temp folder instead of the way it works by default. That's because I wanted to profile AJAX calls, keep multiple runs for the same sites for A/

Re: Problems install/download Django 1.5

2013-03-14 Thread Shawn Milochik
Check out the post I made on this forum about five minutes ago. I put in pretty detailed virtualenv instructions. That should be all you need to get going. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

Re: Novice 101 here

2013-03-14 Thread Jonathan Baker
After you've successfully followed Shawn's directions, you can make your virtualenv experience even better by installing virtualenvrwapper: http://virtualenvwrapper.readthedocs.org/en/latest/ On Thu, Mar 14, 2013 at 7:59 AM, Shawn Milochik wrote: > Download virtualenv and create a virtualenv by

Re: Novice 101 here

2013-03-14 Thread Shawn Milochik
Download virtualenv and create a virtualenv by manually typing the path to your Python 2.7 executable. Something like this (path will probably be different on your Mac, type "which python2.7" to find it: /usr/bin/python2.7 virtualenv.py /home/user/my_virtualenv Then activate your virtualenv: so

Re: django templates and tex/latex

2013-03-14 Thread Bill Freeman
Note that you don't have to use the Django template engine to render things. For one thing, if you found a less problematic templating engine, using it as well doesn't prevent you from using Django's template engine for other pages. You could also roll your own by coming up with, for example, a T

How best to cache a queryset of Comments?

2013-03-14 Thread Phil Gyford
I have a site that uses the standard Django Comments app (well, a subclass of it, with not many changes) for comments on different content types. I'd like to be able to cache a list of comments, as fetching the comments is one of the most frequent and slowest queries that's happening at the moment

Re: Novice 101 here

2013-03-14 Thread songdeed
I'll revise that to having django 1.5... not that it makes much difference to my issue I am sure. On Thursday, March 14, 2013 11:03:40 PM UTC+13, song...@gmail.com wrote: > > Mac Os X version 10.4.11 (pretty old desktop but believe it's sufficient > to do the job) > Python version 2.7.3 > also a

Novice 101 here

2013-03-14 Thread songdeed
Mac Os X version 10.4.11 (pretty old desktop but believe it's sufficient to do the job) Python version 2.7.3 also appear to have a version 2.3 of python on here , not sure if that's any issue. I have a problem linking python to django So to keep things simple I have no idea . https://www.djan

django mysql charset settings

2013-03-14 Thread peixinchen
my MySQL variables like this: | character_set_client | latin1 | character_set_connection | latin1 | character_set_database | utf8 How can i set in django could make character_set_client and character_set_connection to 'UT

django / django cms + responsive

2013-03-14 Thread Frank Bieniek
Hi Guys, what are your preferred apps to turn django or django cms into a responsive website? What are your recipes? Thanks Frank -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from i

Re: Problems install/download Django 1.5

2013-03-14 Thread breg
"Internal server error" - standard apache message. But to clarify: when I take the syntax typos out, the poll admin backend works fine. So somehow just the "Debug = true" does not trigger the django error handler any more. This might be caused by my (failed) trials to "Install current Django on

Profiling django apps using Python 3? No hotspot module.

2013-03-14 Thread Thomas Weholt
I've tried to find middleware for django or other methods of profiling my django apps, but most of them seem to use the hotspot module and since I use Python 3 and there's no hotspot module in Python 3 I was wondering if anybody out there had a working profiler for django compatible with Python 3?

Re: Asking for opinion about an Agile Web Framework Comparison

2013-03-14 Thread SeS
hi David, Very nice work, i appreciate how well it's structured and planned, but term 'agile web frameworks' wonders me every time i saw it is used. Isn't it true that 'agile' is a certain methodology, set of practices which might be applied to a many processes humans involved in, including soft

Re: direct_to_template replacement for django 1.5?

2013-03-14 Thread Russell Keith-Magee
On Thu, Mar 14, 2013 at 3:20 PM, alex.v.ko...@gmail.com < alex.v.ko...@gmail.com> wrote: > Hi, > > In django 1.4 and prior the following shortcut has been found and used > extensively: > > --- > from django.views.generic.simple import direct_to_template > def home(request): > return di

direct_to_template replacement for django 1.5?

2013-03-14 Thread alex.v.ko...@gmail.com
Hi, In django 1.4 and prior the following shortcut has been found and used extensively: --- from django.views.generic.simple import direct_to_template def home(request): return direct_to_template(request, 'form.html', {'somevar':1}) --- This is much shorter then to write ful