Save uploaded file to remote machines?

2010-12-27 Thread Andy
I'm using forms.FileField() to allow users to upload photos. After a photos is uploaded, I want to save the photo to one or more than one remote machine(s) which are dedicated to serving images. How do I do that? Thanks. -- You received this message because you are subscribed to the Google

Re: Generate template files, lazy-loading

2010-12-27 Thread Mayuresh Phadke
You could cache the output, some thing like: def generate_questionnaire_view(): if is_cached_output_available(): return get_cached_oputput() else: output_html = render_to_string(your parameters) add_to_cache(output_html) return

Re: Efficient Grouping of Database Query

2010-12-27 Thread Mayuresh Phadke
You could use the "regroup" template tag to achieve this. http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup Regards, Mayuresh http://twitter.com/#!/ geeroo

Re: Massive insertion of records

2010-12-27 Thread W. Craig Trader
Hey ... that's left as an exercise for the student, and wasn't relevant to the point in question (doing commits along the way). In point of fact, when doing mass inserts, serious attention needs to be paid to how frequently to commit, and what to do about failures and other exceptional behavior.

Re: loading the external css file

2010-12-27 Thread Bithu
When i was trying to set my static files. When i added the 'django.contrib.staticfiles' into INSTALLED_APP in my setting.py the development server was not running showing an error Error: No module named staticfiles. On Dec 27, 7:07 pm, Chris Lawlor wrote: > Django

Re: Product to help Localize Django Application

2010-12-27 Thread Lachlan Musicman
On Wed, Dec 22, 2010 at 04:31, Tom Evans wrote: > If you prefer to edit pofiles offline, then I would also recommend > poedit[1], which has builds for most operating systems. Or, if you are a KDE user, Lokalize is very good, although notepad will also suffice. >

Re: @property: 'Property' is not defined / what am I missing?

2010-12-27 Thread Karen Tracey
On Mon, Dec 27, 2010 at 7:30 PM, Malte Beckmann < monolithca...@googlemail.com> wrote: > Hi all! > > Noob issue: Trying to get the @property decorator to work. Django complains > "NameError: name 'Property' is not defined". What is it that I am failing to > import and or define? And should I have

@property: 'Property' is not defined / what am I missing?

2010-12-27 Thread Malte Beckmann
Hi all! Noob issue: Trying to get the @property decorator to work. Django complains "NameError: name 'Property' is not defined". What is it that I am failing to import and or define? And should I have found out about it? Thankful for pointers! /aub -- You received this message because you are

Re: Current Django 1.3 Alpha 2 Documentation as PDF

2010-12-27 Thread ckar...@googlemail.com
Current Doc: http://ubuntuone.com/p/Vb6/ (Is's 1.3.0 Beta 1 now [1]) Changelog according to [2] [1] http://code.djangoproject.com/changeset/15066/django/trunk?old=14893#file36 [2] http://code.djangoproject.com/changeset/15066/django/trunk/docs?old=14893_path=django%2Ftrunk%2Fdocs -- You

Re: Massive insertion of records

2010-12-27 Thread Silva Paulo
>From the documentation ... Pls.: you want the "try " part instead of transaction.commit() alone because if something went wrong you still want the rollback. from django.db import transaction @transaction.commit_manually def viewfunc(request): ... # You can commit/rollback however and

Re: django test framework with no models.py

2010-12-27 Thread Karen Tracey
On Mon, Dec 27, 2010 at 9:58 AM, Henrik Genssen wrote: > I wanted to write a test for an app, that does not have a models.py itself. > Doing so I get: > django.core.exceptions.ImproperlyConfigured: App with label service could > not be found > > if I create a models.py

Efficient Grouping of Database Query

2010-12-27 Thread greg
Hi, I'm trying to render a page with a table of records. Each entry in the table is a 'Lift' which I need grouped by weight_class and then only the top result for each lift shown. So far example if I have something like this in the database: weight_class | event | weight 132

Re: automatic addition of several ForeignKeys to model

2010-12-27 Thread Emmanuel Mayssat
yes and no ;-) I am not sure I understand clearly, but I believe you want to have let's say 2 word1 links in word2 For that you need yo use the related_name as otherwise in word1, django tries to create 2 word2 fields (which result in an error) 149 class Mentorship(models.Model): 154 mentee =

can't pickle Input objects -- error in django 1.3 beta 1 with memcached cache backend

2010-12-27 Thread Viktor Kojouharov
Hi, With django 1.3 alpha 1, I was using the following piece of code in my urls.py without a problem: cache_page(views.IndexView.as_view(), timeout) When upgrading to 1.3 beta 1, I got this error: Environment: Request Method: GET Request URL: http://localhost:8000/bg/ Django Version: 1.3

Re: loading the external css file

2010-12-27 Thread Emmanuel Mayssat
You template should all inherit from (aka extend) a base template. So include the html code for the ccs in the base template... -- Emmanuel Mayssat On Mon, Dec 27, 2010 at 6:07 AM, Chris Lawlor wrote: > Django doesn't server static files (like your CSS file) by default -

Re: evalute variable inside block tag ¿is it posible?

2010-12-27 Thread Nuño Iglesias
> basically it does not evaluate de content of "{{audio_file}}". > I'm not sure if what i want can be done...or simple i need to look for > other way. > Sorry, That is not true. i was making another mistake. If I do this: {%if song

evalute variable inside block tag ¿is it posible?

2010-12-27 Thread Nuño Iglesias
Hi, I'm doing some testing to insert a litle flash mp3 player in a page. The player I have chosen is this: http://pyjax.net/blog/1/2007/06/27/django-flash-audioplayer/ The template load fine and the players works fine... The problem comes when I try to load the song URL from a Django

add already existing items in database to field "synonims" as a hyperlinks

2010-12-27 Thread gintare
I mean to add already existing items in database to field "synonims" as a hyperlinks. > class word1(models.Model): > item=models.CharField(blank=True) > > class word2(models.Model): > itemSynonims=models. ??? HOW to define that this field will consist of > references to another words in

automatic addition of several ForeignKeys to model

2010-12-27 Thread gintare
Hello, I would like to add ForeignKey which would ass many items to class as much i append-create-give. class word1(models.Model): item=models.CharField(blank=True) class word2(models.Model): itemSynonims=models.ForeignKey(word1) i would like to add several word1 to the class word2.

Re: Logging Handler AdminEmailHandler not working

2010-12-27 Thread jamstooks
I'm seeing the same error. It looks an awful lot like a bug, because the parameters don't line up to the ExceptionReporter: def __init__(self, request, exc_type, exc_value, tb, is_email=False): It looks like *exc_info should contain the kwargs for exc_type, exc_value, and maybe tb, but it's

Re: How to verify the content-type & charset of uploaded file?

2010-12-27 Thread Bill Freeman
This is something of an artificial intelligence problem. First, if it claims to be ASCII and contains bytes with the high bit set, be suspicious. If it claims to be UTF-8 (or another UTF encoding), see if python can "decode" it into a unicode string (there may be an external app that will try

Re: What's your workflow?

2010-12-27 Thread Subramanyam
hi On Fri, Dec 24, 2010 at 10:32 AM, Dana wrote: > @Subramanyam > > > South is a good tool, but my point is its better not to get to the point > > that we have to use South. > > Why do you think South is a fallback rather than part of your toolset? > From what I can see

Re: inline-model-formset help

2010-12-27 Thread Burhan
Thanks for that, I managed to get my form working the way I want. Now the only problem is I need to duplicate this form, well, actually, I need the user to be able to add multiple "items" in one view. Right now my form is "ModelForm", so to get multiple model forms in one view (and get the

Re: documentation in chm format

2010-12-27 Thread Keats
thanx ! :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-27 Thread easylancer
I had this same issue before and it was due to TEMPLATE_CONTEXT_PROCESSORS being missing. Try adding code below in settings.py if not already there. TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug',

Re: admin media permission error on Nginx, can anyone help

2010-12-27 Thread easylancer
Did you try my config? I have never had any problems with css not loading in admin with that config. Make sure you clear your cache once you change the config and remember to reload nginx. On Dec 27, 3:21 pm, Footee wrote: > Thnx for reply but my problem is: > > nginx can

Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-27 Thread Lee Connell
I have my media url and root set: MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media') This is what my template has: Postfix Log Viewer The {{ MEDIA_URL }} shows up blank -- You received this message because you are

Problem with spliting project into meaningfull apps.

2010-12-27 Thread Mateo
Hey, I have problem with dividing my project into apps that have point, I have database that consist of : - news - reviews - predictions - articles - download - games - gallery - categories - users - comments - producer I’ve grouped them like that: 1. Content Management app 2. Comments Management

documentation in chm format

2010-12-27 Thread Aryeh Leib Taurog
I have compiled the documentation for various versions of Django to windows compiled html format. The chm files are available here: http://www.aryehleib.com/CHM.html I hope others will find them as useful as I do. Aryeh Leib -- You received this message because you are subscribed to the

Re: admin media permission error on Nginx, can anyone help

2010-12-27 Thread Footee
Thnx for reply but my problem is: nginx can locate and open the sources in site_media/static/ & site_media/media/ corrected but can not open the sources in site_media/admin (from the message in nginx error_log) the xxx.xxx.xxx.xxx/admin looked wired without css. On Dec 27, 9:56 pm, easylancer

django test framework with no models.py

2010-12-27 Thread Henrik Genssen
Hi, I wanted to write a test for an app, that does not have a models.py itself. Doing so I get: django.core.exceptions.ImproperlyConfigured: App with label service could not be found if I create a models.py with just a "pass" in it everything works as expected. I use Django 1.1 Is this a bug

Re: Massive insertion of records

2010-12-27 Thread W. Craig Trader
Derek ... Quoting from http://docs.djangoproject.com/en/1.2/topics/db/transactions/: > Django’s default behavior is to run with an open transaction which it > commits automatically when any built-in, data-altering model function is > called. For example, if you call model.save() or

Generate template files, lazy-loading

2010-12-27 Thread Guax3
I have a template in where I load a set of questions for a a questionnaire, and each question has a set of options all this information is retrieved from a database. so there's one for to questions and another for to options, that gives: {% for question in questionnaire %}

Re: ModelForm Field not display choice text

2010-12-27 Thread Michael Thamm
Thanks very much - that does help. I'm surprised it has to be done in jquery. But if it works, I'm all for it. Thanks again. On Dec 27, 9:16 am, Chris Lawlor wrote: > Michael, > > In one of my projects, I did something like this: > > >     {% for field in rating_form %}

Re: ModelForm Field not display choice text

2010-12-27 Thread Chris Lawlor
Michael, In one of my projects, I did something like this: {% for field in rating_form %} {{ field}} {% endfor %} $('#stars').children().not(":radio").hide() $('#stars').stars({ cancelShow: false, callback: function(ui, type, value){

Re: loading the external css file

2010-12-27 Thread Chris Lawlor
Django doesn't server static files (like your CSS file) by default - but you can configure the development server to do so: http://docs.djangoproject.com/en/dev/howto/static-files/ Note that this has changed a lot in Django 1.3, so be sure to view the correct version of that page for the version

Re: admin media permission error on Nginx, can anyone help

2010-12-27 Thread easylancer
I server up my django apps on nginx using the following config file server { listen 80; server_name domain.com; root /location/of/application access_log /location/to/logs/application.access.log; error_log /location/to/logs/application.error.log;

loading the external css file

2010-12-27 Thread Bithu
When i was trying to load an external stylesheet it was not working. But the internal css is working nicely. What should i do to link my .css file to my html template which is inside my template folder. -- You received this message because you are subscribed to the Google Groups "Django users"

Problem while installing django-tagging

2010-12-27 Thread Bithu
When i was trying to install the django-tagging in my app the following error appeared.. I tried setting the PYTHONPATH but it was still not working. Can any one help python2.5 setup.py install b...@bios-hackzone:~/djcode/mysite/django-tagging$ python2.5 setup.py install Traceback (most recent

admin media permission error on Nginx, can anyone help

2010-12-27 Thread Footee
in these days, i try to build the django on my host, But the http://xxx.xxx.xxx.xxx/admin can't get the default css. the nginx catch these errors: 2010/12/27 04:45:26 [error] 24442#0: *76 open() "/home/peng/jiangyo/ site_media/admin/css/base.css" failed (13: Permission denied), client:

Re: ModelForm Field not display choice text

2010-12-27 Thread Michael Thamm
One thought, and this maybe the whole issue, is that the radio button is using labels for the text and not titles. I would expect the output to be something like this: but instead the output is like this: 1 Is this something that anyone else has had to deal with? Thanks Michael On Dec

ModelForm Field not display choice text

2010-12-27 Thread Michael Thamm
Hi, I am using the jQuery stars on a radio field as a custom renderer. The stars come up nicely but the choice text still displays to the side of the stars. How can I not show the choice text but still populate the field with the choice result? I am displaying the field in the template like this:

Re: Parse content

2010-12-27 Thread derek
Not sure what you mean by "the model view", but its possible to create code to parse the text and use that in a specialised tag. See, for example, http://code.djangoproject.com/wiki/contentBBCode_parser On Dec 24, 4:13 pm, Jonas Geiregat wrote: > Hello, > > I have some

Re: Massive insertion of records

2010-12-27 Thread derek
Can you explain what you mean by "manual commitments" (preferably with a code example)? Thanks Derek On Dec 26, 4:38 am, Silva Paulo wrote: > OK. I found a "solution". > Using manual commitments after lots of insertions (ex. >1000) makes the > massive insertion very fast

Re: modelform with many_to_many key with textinput widget

2010-12-27 Thread Emmanuel Mayssat
It seems I have to develop a custom django html widget same concept on this page (look at the render method) http://www.huyng.com/archives/django-custom-form-widget-for-dictionary-and-tuple-key-value-pairs/661/ so apparently I need a subclass of TextInput widget with a different render method.

Re: inline-model-formset help

2010-12-27 Thread Emmanuel Mayssat
I don't think you want a form set, but rather a modelform. Look at the top (not the bottom!) of the page http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ On Mon, Dec 27, 2010 at 12:06 AM, Burhan wrote: > Thanks, but I'm not sure which models to pass to it,

Re: Group models by personal order and no by app in admin

2010-12-27 Thread Álex González
Thanks Mikail! I'm going to test it :) On Fri, Dec 24, 2010 at 19:06, Mikhail Korobov wrote: > Hi Alex, > > django-admin-tools should solve all your problems with admin index > page. > > https://bitbucket.org/izi/django-admin-tools/ > > On 24 дек, 17:48, Álex González

Re: inline-model-formset help

2010-12-27 Thread Burhan
Thanks, but I'm not sure which models to pass to it, when it asks for two models in this: " If you want to create a formset that allows you to edit books belonging to a particular author, you could do this: >>> from django.forms.models import inlineformset_factory>>> BookFormSet = >>>