Re: Translation

2010-08-11 Thread Kenneth Gonsalves
On Tue, 2010-08-10 at 09:43 -0700, kostia wrote: > Docs and djangobook useless in question of translation. Any other > guide to read is available? they are not useless - they are very comprehensive. That said, the i18n page and l10n page have been split. You need to read both the i18n page and th

Re: Translation

2010-08-11 Thread Kenneth Gonsalves
On Tue, 2010-08-10 at 10:27 -0700, kostia wrote: > Of couse I included a {% load i18n %} tag and then used {% trans %} > tags in each file. > > Still no solution how about compilemessages and makemessages? did you do that? -- regards Kenneth Gonsalves -- You received this message because you

Re: do QuerySet joins still suck?

2010-08-11 Thread akaariai
On Aug 11, 9:44 am, Sam Walters wrote: > I dont think they do. > > The only time i use raw sql + joins is for performance... eg: > > When you have a model and for each instance of that model it has a > reverse foreignkey relationship where you would have to call: > _set.all() > in a for loop thus

Re: Translation

2010-08-11 Thread Kenneth Gonsalves
On Tue, 2010-08-10 at 11:11 -0700, kostia wrote: > I guess some guru can look at the code above and find an error. If I > will be so lucky) I cannot see a locale folder in your site - how do you expect translation to work without that? -- regards Kenneth Gonsalves -- You received this message

Re: Problem with cache.

2010-08-11 Thread Felipe
In a view. I know that the cache is updated automatically, but the problem is that the cache is generating numbers that does not exists, and when the page is consulting the cache to get the values, it show a value that does not exists in really if you look into the database. It's really strange.

Re: Problem with cache.

2010-08-11 Thread Aljoša Mohorović
On Wed, Aug 11, 2010 at 12:27 PM, Felipe wrote: > The number 487.000 for example, that would stay the same value for all > the time is changing with a certain frequency when django consult it's > cache in /var/tmp/djangocache and the value showed is 287.000. > > The cache is generating strange val

autoincrementation of default value in admin form

2010-08-11 Thread bagheera
I have PositiveIntegerField in my model, that represents unique, new number of newly added element (it's newspaper no.). It must be editable in admin form. Now i would to assign a default value to the next available integer, so person, who will be adding new element, have that field autopopu

Image and thumbnal solution

2010-08-11 Thread zero00
I been trying to do a very simple image/thumbnail solution but I seem to fail at every try. I tried the most simple way: class Model(models.Model): thumbnail = models.ImageModel(upload_to="thumb_path" height=100, width=100) image = models.ImageModel(upload_to"image_path") but apparently th

Re: Image and thumbnal solution

2010-08-11 Thread Aljoša Mohorović
On Wed, Aug 11, 2010 at 1:00 PM, zero00 wrote: > I tried the most simple way: > > class Model(models.Model): >   thumbnail = models.ImageModel(upload_to="thumb_path" height=100, > width=100) >   image = models.ImageModel(upload_to"image_path") > > but apparently the default save function is not eq

Django images, can't load a simple image into html page when I using django!

2010-08-11 Thread pj-linden
Hi! I have yust started with a django project and have the default settup, I have followed the django tutorials and now I am trying to load an image into the html page that i have created but for some reason the image will not show! when i using chrome as the reader of the page I can read in the j

Re: 'module' object has no attribute 'instancemethod' error

2010-08-11 Thread Reinout van Rees
On 08/10/2010 09:53 PM, Wim Feijen wrote: Exception Type: ViewDoesNotExist at / Exception Value: Tried book in module book.address.views. Error was: 'module' object has no attribute 'instancemethod' It *looks* like you're using 'instancemethod' in that views.py, but that it isn't available in

Re: Django images, can't load a simple image into html page when I using django!

2010-08-11 Thread Aljoša Mohorović
On Wed, Aug 11, 2010 at 1:14 PM, pj-linden wrote: > I have yust started with a django project and have the default settup, > I have followed the django tutorials and now I am trying to load an > image into the html page that i have created but for some reason the > image will not show! > when i us

Re: Reporting Library??

2010-08-11 Thread koenb
On 11 aug, 03:15, ydjango wrote: > I need a reporting library for web based (HTML) reporting with support > for standard features > 1) header > 2) footer > 3) pagination > 4) Totals/summary > > Reportlab is too low level for my needs and their pro version license > does not work for me. > > Is the

Re: Image and thumbnal solution

2010-08-11 Thread zero00
Im getting this error: TypeError at /admin/services/service/add/ getattr(): attribute name must be string Request Method: POST Request URL:http://localhost:8000/admin/services/service/add/ Django Version: 1.2.1 Exception Type: TypeError Exception Value: getattr(): at

Re: Image and thumbnal solution

2010-08-11 Thread Aljoša Mohorović
> image = models.ImageModel(upload_to"image_path") is this copy/paste error or did you forget "=" for upload_to? Aljosa Mohorovic -- 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.co

Re: Reporting Library??

2010-08-11 Thread Carlos Daniel Ruvalcaba Valenzuela
There is also trml2pdf [1] which parses a subset of RML (XML format used in Reportlab Pro) and renders it via reportlab, is relatively easy to generate the format and has most of the features you want. There is also template2pdf [2] which uses trml2pdf and integrates it with django (so you can use

Re: Image and thumbnal solution

2010-08-11 Thread zero00
that just a typo in the post. the code is fine. i also know the plugins you said but i want to learn how to build my own solution. -- 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.co

Re: problem with a formset from model

2010-08-11 Thread Nuno Maltez
This happens to me as well (also with 1.2.1). Seems like a bug with _queryset vs queryset on BaseModelFormSet. Maybe you could submit a ticket to http://code.djangoproject.com/query Nuno On Tue, Aug 10, 2010 at 9:21 PM, refreegrata wrote: > Hello list. I have a problem. I'm a newbie in Django u

Re: Image and thumbnal solution

2010-08-11 Thread zero00
Im testing various things right now and i narrow the problem to this: height_field=150, width_field=150 thumb = models.ImageField(upload_to="images/services/thumbs", height_field=150, width_field=150) those parameters are the thing thats breaking up the code -- You received this message becau

Re: Image and thumbnal solution

2010-08-11 Thread Aljoša Mohorović
On Wed, Aug 11, 2010 at 2:02 PM, zero00 wrote: > Im testing various things right now and i narrow the problem to this: > >  height_field=150, width_field=150 > > thumb = models.ImageField(upload_to="images/services/thumbs", > height_field=150, width_field=150) > > those parameters are the thing th

Re: Image and thumbnal solution

2010-08-11 Thread zero00
I get it now thanks -- 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, v

Re: Image and thumbnal solution

2010-08-11 Thread Aljoša Mohorović
On Wed, Aug 11, 2010 at 2:26 PM, zero00 wrote: > I get it now thanks no problem, glad i could help. -- 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 gr

Re: problem with a formset from model

2010-08-11 Thread refreegrata
ok, i understand. On 11 ago, 08:00, Nuno Maltez wrote: > This happens to me as well (also with 1.2.1). Seems like a bug with > _queryset vs queryset on BaseModelFormSet. > > Maybe you could submit a ticket tohttp://code.djangoproject.com/query > > Nuno > > On Tue, Aug 10, 2010 at 9:21 PM, refreeg

add attributes to a field without widgets

2010-08-11 Thread refreegrata
Hello list. I'm a newbie in django and now i am working with "modelformset_factory". I have something like this -- class MyForm(forms.ModelForm): myField = forms.BooleanField

convert textinput in label or text for a modelform and modelformset_factory

2010-08-11 Thread refreegrata
with a model like this: -- class Format(models.Model): name1 = models.CharField(max_length=5) name2 = models.CharField(max_length=5) -- and a modelform like this: - M

filter users by group

2010-08-11 Thread Wim Feijen
Hello, I am banging my brain against the wall but it doesn't help and all I get is brain damage. Maybe you can help me find a solution for the following problem? How can I add a filter to the django admin User interface (/admin/auth/ user/) so I can filter Users by Group? What I have thought of,

I need a middleware to add language to urls in my templates

2010-08-11 Thread Alessandro Ronchi
I have a website that uses a get variable to set the django language. After that, a user can navigate the site in the choosen language. Web spiders, instead, reads all the web pages In standard language, because links doesn't have ?lang=en So, as a result, all my translated pages aren't on google.

Re: add attributes to a field without widgets

2010-08-11 Thread Roald de Vries
Hi refreegrata, On Aug 11, 2010, at 3:31 PM, refreegrata wrote: Hello list. I'm a newbie in django and now i am working with "modelformset_factory". I have something like this ---

Re: I need a middleware to add language to urls in my templates

2010-08-11 Thread Nuno Maltez
I'm not sure if this provides exactly what you need, and I've never tested it with satchmo, but I've been using http://code.google.com/p/django-localeurl/ with success to proved different urls according to the language transparently. Maybe this helps, Nuno On Wed, Aug 11, 2010 at 3:46 PM, Alessan

MySQL-Python and Python 2.7

2010-08-11 Thread Sithembewena Lloyd Dube
Hi all, Has anybody used Django 1.2.1. on Windows 7 with MySQL-Python? I see that MySQL-Python supports up to Python 2.6 and I am wondering if it will play nicely with Python 2.7? I need this information for a new project at work. With thanks, -- Regards, Sithembewena Lloyd Dube http://www.lloy

Re: add attributes to a field without widgets

2010-08-11 Thread refreegrata
Opps, I forgot to mention that I work with "Django 1.2.1". Apparently is a Django bug. Other persons has the same question "http://groups.google.com/group/ django-users/browse_thread/thread/c4899b0806e67ee7/d938f33a5f100af8? show_docid=d938f33a5f100af8&fwc=1" I will try to implement the solution y

[Offtopic] Freelance django dev in Spain

2010-08-11 Thread Matias
Hi, We are looking for a freelance django dev located here in Spain, preferrably in Madrid. Please, contact me at matiassu...@gmail.com if you want to know more about this opportunity. Sorry for the offtopic. -- You received this message because you are subscribed to the Google Groups "D

Re: Translation

2010-08-11 Thread kostia
Great. It somehow got working. I have the next code in the template: {% blocktrans with form_type|capfirst as task %}{{ task }} project{% endblocktrans %} Rosetta shows me an error in the left window: %(task)s project And when I try to compilemessages, terminal also shows an error: [r...@baikal

Re: [Offtopic] Freelance django dev in Spain

2010-08-11 Thread Subhranath Chunder
I'm a Django developer working on Django since December 2009. If you are looking for freelance developer on Django, then I might be interested. Thanks, Subhranath Chunder. On Wed, Aug 11, 2010 at 10:07 PM, Matias wrote: > Hi, > > We are looking for a freelance django dev located here in Spain,

overwrite the save method

2010-08-11 Thread refreegrata
Hello list, i have a newbie question My code -- class Format(models.Model): name = models.CharField(max_length=5, unique=True) myBoolean = models.BooleanField(default=False) class FormFormat(forms.ModelForm): boolean1 = forms.BooleanField(required=False

Re: overwrite the save method

2010-08-11 Thread bagheera
-- class Format(models.Model): name = models.CharField(max_length=5, unique=True) myBoolean = models.BooleanField(default=False) class FormFormat(forms.ModelForm): boolean1 = forms.BooleanField(required=False) boolean2 = forms.BooleanField(required=

forms tutorials

2010-08-11 Thread Jagdeep Singh Malhi
Hi... I done the tutorials http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04 for create the form using database. Now i want to study more tutorials/examples which is helpful for me to create the forms using database. if anybody know about the links/websites/other sources rel

Adding request context to standard login/logout views?

2010-08-11 Thread Streamweaver
I use the the standard django login and logout views in the usual way url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.xhtml'}, "login-account"), url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'accounts/logout.xhtml'}, "logout-a

Re: overwrite the save method

2010-08-11 Thread Roald de Vries
On Aug 11, 2010, at 7:25 PM, refreegrata wrote: My code -- class Format(models.Model): name = models.CharField(max_length=5, unique=True) myBoolean = models.BooleanField(default=False) class FormFormat(forms.ModelForm): boolean1 = forms.BooleanField(requi

Re: Adding request context to standard login/logout views?

2010-08-11 Thread Streamweaver
Argh!! Please ignore. This is not the message you're looking for. context varibles are passed to generic views by default. I got my errors confused. On Aug 11, 2:59 pm, Streamweaver wrote: > I use the the standard django login and logout views in the usual way > >     url(r'^login/$', 'django

Re: Web site Mail Inbox

2010-08-11 Thread kostia
Great, I installed django-messages. They are working fine. As in docs said I have a content and sidebar blocks. How can I show on the user profile page a nice Inbox in the sidebar? Docs does not show any examples. If you did this before, share the code, please. Thank you -- You received this m

Re: Adding request context to standard login/logout views?

2010-08-11 Thread Roald de Vries
On Aug 11, 2010, at 8:59 PM, Streamweaver wrote: I use the the standard django login and logout views in the usual way url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.xhtml'}, "login-account"), url(r'^logout/$', 'django.contrib.auth.views.logout', {'te

Re: forms tutorials

2010-08-11 Thread Nick
The best option would be to break off of the tutorials for a bit and try to build something out on your own. The documentation for forms is quite extensive. I recommend getting comfortable with inlines and formsets http://docs.djangoproject.com/en/1.1/topics/forms/ On Aug 11, 1:39 pm, Jagdeep S

Re: passing file from command line startup

2010-08-11 Thread Roald de Vries
On Aug 11, 2010, at 8:47 PM, Bradley Hintze wrote: Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? Option 1: use stdin ~$ python myscript.py < mytext.txt >>> import sys >>> fi

stream (large) files from the back-end via Django to the user?

2010-08-11 Thread Markus
Hi, it was hard to find the right subject. Let me explain what I want to do. I write a web application with Django. I have some forms to upload content and some forms to download content. Sometimes the content is just a string (than it will be stored in a database) but sometimes the content is a

schema support

2010-08-11 Thread John Fabiani
Hi, I think support for postgres schema's is coming in 1.3 but I wonder is it possible to support schema in 1.2.1? If it can - could someone provide the how? or maybe a link. Thanks in advance, Johnf -- You received this message because you are subscribed to the Google Groups "Django users"

Problem with dumpdata and loaddata in python format

2010-08-11 Thread Info Cascade
Hi -- I'm expecting python manage.py dumpdata --format=python ... to dump data, but it does not. I get "Error: Unknown serialization format: python" instead. Specifying json or xml does work, however. Same for loaddata. "Problem installing fixture 'fixtures/bme_auth': python is not a known seri

Re: overwrite the save method

2010-08-11 Thread Nick
You override the save in two places, in the form itself or in the view. Either one would work, you could combine the two as well. the form save override would look something like def save(self): formatform = super(FormFormat, self).save(commit=False) if formatform.boolean1 and formatform.

Re: Image and thumbnal solution

2010-08-11 Thread Franklin Einspruch
I still don't get this. Are you supposed to do something like... image = models.ImageField() image.height_field = 'height' image.width_field = 'width' And make 'height' and 'width' columns in the table? I really wish the docs had some sample code here... - Franklin On Wed, Aug 11, 2010 at 8:

Re: filter users by group

2010-08-11 Thread Nick
You can subclass the User admin and then unregister the default admin and register your new subclassy admin (subclassy is a word) in admin.py: from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User class MyNewUserAdmin(UserAdmin): list_filter = UserAdmin.

Re: dynamic forms and custom methods

2010-08-11 Thread Nick
Are you trying to create a save function that evaluates all the weights and returns an error if they are more than 1? On Aug 10, 3:17 pm, lingrlongr wrote: > I 'm trying to create a form dynamically.  This works just fine, but > there's no way for the form to offer any customized validation, by w

Re: Loop over a form's choices (radio button) and render it

2010-08-11 Thread Andreas Pfrengle
Just to push it up again... any ideas? -- 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.

Many to many fields to string

2010-08-11 Thread Wendy
Hello, I'm just getting started, and I'm returning a many to many object in my template: p>{{ film.filmmakers.all }} So it's displaying the list: [, ] Can anyone tell me how to return just a string of the names? I'm still getting acclimated to python syntax. Actually in a perfect world, it wou

easy_thumbnails, rackspace's python-cloudfiles and PIL problem

2010-08-11 Thread Michel Thadeu Sabchuk
Hi guys! I'm migrating from sorl thumbnails to the good easy_thumbnails [1] for image dealing. It let me store the thumbnails on a container on Rackspace Cloudfiles [2] (similar to Amazon S3). I try it for jpeg images and it worked perfectly: it get's the file from my container, crop the image wi

Re: MySQL-Python and Python 2.7

2010-08-11 Thread cootetom
I use Django 1.2 on Windows 7 using MySQL-Python and Python 2.6. What's wrong with using Python 2.6 instead of 2.7? On Aug 11, 4:13 pm, Sithembewena Lloyd Dube wrote: > Hi all, > > Has anybody used Django 1.2.1. on Windows 7 with MySQL-Python? I see that > MySQL-Python supports up to Python 2.6

Re: Loop over a form's choices (radio button) and render it

2010-08-11 Thread Bill Freeman
Non-trivial. I would up writing a template filter to do this. You have to use undocumented, I believe, interfaces. I called my filter checkboxiterator, so usage looks something like: {% for pseudocheckbox in some_multi_select_field|checkboxiterator %} It iterates over a set of instances of a

pyfacebook

2010-08-11 Thread Alessandro Ronchi
Is pyfacebook compatible with django 1.2.1? I didn't find nothing, and it gives me a 403 error I cannot understand: Premature end of script headers: fb [Wed Aug 11 16:25:16 2010] [error] [client 66.220.153.249] (104)Connection reset by peer: ap_content_length_filter: apr_bucket_read() failed any

Re: Many to many fields to string

2010-08-11 Thread Carlos Daniel Ruvalcaba Valenzuela
Use a for loop, there is tags to know if you are at the last item of the list, so to not add the and: {% for filmmaker in film.filmmakers.all %} {{ filmmaker.name }} {% if not forloop.last %} and {% endif %} {% endfor %} Assuming you are using django 1.2, but you get the idea. http://docs.django

Re: MySQL-Python and Python 2.7

2010-08-11 Thread Sithembewena Lloyd Dube
Cootetom, there's nothing wrong with using Python 2.6 (which I would prefer) except that the current 2.x download on the Python site is that of 2.7. On Thu, Aug 12, 2010 at 12:24 AM, cootetom wrote: > I use Django 1.2 on Windows 7 using MySQL-Python and Python 2.6. > What's wrong with using Pyth

Re: MySQL-Python and Python 2.7

2010-08-11 Thread Steve Holden
Remember, though, that when Django 1.2 was released the current Python was 2.6. There's not much the Django developers can do to hold up progress on Python. MySQL-Python is a known issue, in that the developer advertises the fact that he has no Windows machines and therefore relies on third partie

Re: Translation

2010-08-11 Thread Lachlan Musicman
On Thu, Aug 12, 2010 at 03:07, kostia wrote: > > Great. It somehow got working. > > I have the next code in the template: > {% blocktrans with form_type|capfirst as task %}{{ task }} project{% > endblocktrans %} > > Rosetta shows me an error in the left window: > %(task)s project > > And when I tr

Re: forms tutorials

2010-08-11 Thread Lachlan Musicman
These are the more up to date docs: http://docs.djangoproject.com/en/dev/topics/forms/ Also, in IRC yesterday Mattmcc (I think) dropped this doozy: http://sprawsm.com/uni-form/ Once you have mastered forms, uni-form should make the css a lot easier - note the django plugin at the bottom of the

Re: manually add objects to a QuerySet

2010-08-11 Thread John M
I asked a similar question like, I want to sort a QS on a meta field, can it be done? The answer worked, and is the same one you're getting, use a list. qs1 = model1.objects.filter(...) qs2 = model2.objects.filter(...) lqs1 = list(qs1) lqs2 = list(qs2) now you have something that is a python li

How long do objects live?

2010-08-11 Thread Andy
When I create an object in Django, how long does it live? When Django finishes responding to a HTTP request, the Python process lives on to serve the next request. Does that mean all those objects that were created would continue to hang around? -- You received this message because you are subsc

Re: How long do objects live?

2010-08-11 Thread Mike Dewhirst
On 12/08/2010 11:24am, Andy wrote: When I create an object in Django, how long does it live? When Django finishes responding to a HTTP request, the Python process lives on to serve the next request. Does that mean all those objects that were created would continue to hang around? No. As soon a

Re: Many to many fields to string

2010-08-11 Thread Joseph Spiros
Er, I forgot to add an {% endwith %} at the end. You don't HAVE to use the with tag at all, but it can make things a bit easier. On 8/11/10 6:18 PM, Joseph Spiros wrote: > You'll want to loop through the objects and print the appropriate > property of the objects that consists of just the name. He

Re: Many to many fields to string

2010-08-11 Thread Joseph Spiros
You'll want to loop through the objects and print the appropriate property of the objects that consists of just the name. Here's some template code that does that, and also separates with commas and "and", using a serial comma (aka Oxford comma). (This assumes that your Filmmaker model has a "name

Re: How long do objects live?

2010-08-11 Thread Masklinn
On 2010-08-12, at 03:24 , Andy wrote: > When I create an object in Django, how long does it live? > I would suggest that you read up on Python and its life cycles, as that's what the objects you create in django are. -- You received this message because you are subscribed to the Google Groups

Moodle and Django - access to Moodle databases

2010-08-11 Thread jfine
Hi Anyone here interested in Moodle (the leading open source virtual learning environment, with a vibrant community and written in PHP)? I've just started a project, whose goal is to give Django access to Moodle databases. You can see it at http://bitbucket.org/jfine/django-moodle/ A simila