get current logged user from manager

2009-05-15 Thread Gabriel .
Hi All, I have a manager which is used also as related manager: class ReleaseManager(models.Manager): use_for_related_fields = True def all(self): q = self.get_query_set() q.query.add_q(Q(enabled=True) & Q(project__enabled=True)) return q I need to add another f

Re: Use django error style in my templates

2009-05-09 Thread Gabriel
Laszlo Antal escribió: > Hi, > > I wrote my custome admin view and I would like to have the same error > reporting style for edit templates like django's. > > Could someone point me in the right direction on how to have the message > on the top of the page and the red color for the input boxes

Re: User field in a model?

2009-05-05 Thread Gabriel
Fabio Natali escribió: > Dear All, > > I have a Django based web application to gather recipes. I have a > "recipe" model with fields "ingredients", "date added", etc. > > I wish I could keep track of the user who added each recipe. Am I > supposed to add a "user" (or say "cook") field to my rec

Re: please help with FileField(upload_to='foo')

2009-05-05 Thread Gabriel
djangomax escribió: > According to the Django Book for version 1.0, the following should > work: > > fileField = forms.FileField(upload_to='foo') > > However, I get an error saying there was an unexpected argument. Any > idea why? > I'm new to Django and may be doing something outright stupid. >

Re: invoke model's method from template

2009-05-05 Thread Gabriel .
I just wrote an snippet, in case someone is interested. http://www.djangosnippets.org/snippets/1486/ -- Kind Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: invoke model's method from template

2009-05-05 Thread Gabriel .
On Tue, May 5, 2009 at 10:20 AM, Alex Gaynor wrote: > Yes, it's necessary to write your own tag, as you can't call methods that > take parameters from the template language. > > Alex > Thank you for the quick reply. I'll start working on it. -- Kind Regards --~--~-~--~~

invoke model's method from template

2009-05-05 Thread Gabriel .
I have a model with a method, like: class Model .. # class body def is_maintainer(user): #method body Is there any way to invoke this method from a template ? {% if model.is_maintainer request.user %} # this doesn't work or should I write my own tag ? Kind Regards --~--~-~-

Re: slug field not populated on form save

2009-05-01 Thread Gabriel
Malcolm Tredinnick escribió: > The Model class calls pre_save() to work out the value to save into the > database. That's working correctly for you, as you've noticed: the right > value is being saved. > > Some Field subclasses in Django also use pre_save() as a way to > normalise the value in th

slug field not populated on form save

2009-04-30 Thread Gabriel
I have a model with a custom field: class Project(models.Model): slug = fields.AutoSlugField(max_length=50, unique=True, editable=False, prepopulate_from="name", force_update=False) name = models.CharField(unique=True, verbose_name=_('Name'), max_length=50, help_text=_('The project name t

Re: Detecting Disabled Cookies

2009-04-29 Thread Gabriel .
On Wed, Apr 29, 2009 at 3:46 PM, Chris wrote: > > I thought this would be a common question, but Google doesn't show any > Django-specific solutions. What's the general best practice for > detecting disabled cookies in a single request? > Maybe this could help: request.session.test_cookie_worked

I can't get to work a customized error list format

2009-04-19 Thread Gabriel
Hi all, I followed the instructions here (http://docs.djangoproject.com/en/dev/ ref/forms/api/#customizing-the-error-list-format), on how to customize the error list format: class TipErrorList(ErrorList): def __unicode__(self): return self.as_tips() def as_tips(self): i

Per app middleware?

2009-03-23 Thread Gabriel Rossetti
one app's middleware to intercept and process the other app's stuff, does anyone know how to do this? Thank you, Gabriel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Populating foreign key fields when displaying forms that extend ModelForm

2009-02-28 Thread Ionut Gabriel Stan
Hi, I've decided to play a little more seriously with Django and as many other people I begun creating a simple blog application. I've encountered some issues when displaying the comments form, where users are able to add comments to a blog post. I'm creating the form by extending django.forms.

Dreamhost django solution (script)

2008-12-02 Thread Gabriel Falcão
__ Gabriel Falcão Jabber: [EMAIL PROTECTED] Blog: http://www.nacaolivre.org --~--~-~--~~~---~--~~ 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@google

Re: custom auth

2008-11-04 Thread Gabriel Rossetti
Gabriel Rossetti wrote: > Hello everyone, > > I'm trying to get a custom auth handler to work but I keep on getting > this error when accessing request.user.get_profile() : > > DoesNotExist: User matching query does not exist. > > I followed the f

custom auth

2008-10-30 Thread Gabriel Rossetti
odels.ForeignKey(DjangoUser, unique=True) #user = models.OneToOneField(DjangoUser, core=True) # This doesn't work either I really don't see why it doesn't work...does anyone have a clue? Thank you, Gabriel PS I've already looked at past posts on the subject but the commo

Re: shared model

2008-09-26 Thread Gabriel Rossetti
Gabriel Rossetti wrote: > Hello everyone, > > I would like to share a model with all my apps. I moved it from the app > to the project's root dir, but now the admin interface can't find it! > Does anyone know how to do this? I thought of createing empty models in

shared model

2008-09-26 Thread Gabriel Rossetti
del, but I don't really like this. Thank you, Gabriel --~--~-~--~~~---~--~~ 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 unsubscr

Re: Printing out HTML that doesn't get converted to

2008-05-16 Thread Gabriel
Alex gmail.com> writes: > > > I'm working on my first Django project and I can't seem to get > information printed out as I would like it. I'm trying to print out > quotes to a page with the newlines turned into HTML tags (similar > to PHP's nl2br function). So far I've been able to do this u

Re: Django and Linux distros

2008-05-16 Thread Gabriel
JonSidnell gmail.com> writes: > > > Hi everyone > > I'm suddenly struck by the notion that I would like to be dev'ing > Django on Linux of some flavour rather than Windows. > > It's been a wee while since I stuck my toes in the Linux waters, so I > was wondering if anyone here has any recomm

Re: how to avoid uploading .py source files to shared hosting server

2008-05-16 Thread Gabriel
ydjango gmail.com> writes: > I have propriety commercial code and some formula/ algo > implementations which I do not want to expose. > Hence I do not want to upload .py source files > > Is rewriting that business logic in a compiled langauge only way out? > how do I call it from python, Using

Re: encrypting form data

2008-05-15 Thread Gabriel
Mike Chambers gmail.com> writes: > > > Thanks for the input. I was considering doing this, but my only concern > was if the key changed for some reason, I would have to regenerate the > hashes. I might try it out though, and see how well it works. > > Of course, Im not sure why the key woul

Re: encrypting form data

2008-05-15 Thread Gabriel
Mike Chambers gmail.com> writes: > > > I am not concerned if they can send the hash back. I dont want them to > be able to access the underling value that the hash is based on. > > I am also not concerned about spam, but rather just dont want to expose > raw database ids to the public. >

Displaying a many to many relationship using checkboxes...

2008-05-15 Thread Gabriel
o the task: {% for task in all_tasks %} {% for user in all_users %} {% endfor %} {% endfor %} How might I refactor all this code to make it more efficient and generally better? Thanks Gabriel --~--~-~--~~~---~--~~ You received this message b

Re: IDE

2008-03-05 Thread gabriel
What do you think about : eclipse + plugins( pydev + html/css ) eric4 + django plugin SPE - is there plugin for django All of that around for-django usage? Dnia 05-03-2008, śro o godzinie 22:22 +0800, limodou napisał(a): > On Wed, Mar 5, 2008 at 10:32 PM, gabriel <[EMAIL PROTECTED]&

IDE

2008-03-05 Thread gabriel
with IDE with a nice django support - does anything alike exist?? Thanks for your answers, Gabriel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: starting point?

2007-11-21 Thread Gabriel Farrell
If you are stuck with PHP I recommend Symfony (http://www.symfony- project.org/). It's the most Django-like PHP framework I've seen. On Nov 21, 10:24 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > ok! argh... i don't want to use php anymore... :p is there at least a > django like framework

Re: How to define choices that works in admin interface?

2007-11-20 Thread Gabriel Farrell
I'll second Christian Joergensen by saying that foreign key fields are the way to go here, rather than choices hacks. Put those types in another table. gsf On Nov 20, 12:16 pm, David Marko <[EMAIL PROTECTED]> wrote: > Using this I could create a static list only. But what I mean is > dynamic li

Re: Include tag - encoding

2007-11-20 Thread Gabriel Farrell
I don't know details on this, but there have been a lot of improvements to the Unicode handling in versions since 0.96, so an obvious suggestion would be to upgrade to the latest Subversion trunk. That will most likely solve your problem. gsf On Nov 20, 12:09 pm, cwurld <[EMAIL PROTECTED]> wrot

Re: starting point?

2007-11-20 Thread Gabriel Farrell
Hi Horace, Depending on your webhost, you will need to use fastcgi or mod- python. See http://wiki.dreamhost.com/index.php/Django as an example -- therein are the steps necessary to get Django running on DreamHost, a large webhost that supports fastcgi. Also see http://www.djangoproject.com/doc

Re: Error message when viewing admin? (ViewDoesNotExist at /admin/)

2007-10-03 Thread Gabriel Farrell
Did you have a view named "startsess" that you subsequently deleted? Admin is looking for it but not finding it. You may need to remove it from django_content_type. Try dropping that table from your database and running python manage.py syncdb. On Oct 3, 12:34 pm, Greg <[EMAIL PROTECTED]> wrote

Re: Passing a list of field names to the value() method?

2007-06-21 Thread Gabriel Farrell
On Jun 19, 5:19 pm, RichardH <[EMAIL PROTECTED]> wrote: > This is probably more of a Python question than django, but django > provides the context for my problem. > > Requirement: I have got a user defined list of field names (e.g. > field_names=['id','name','description',...]) and I want to pass

Re: CheckboxSelectMultiple error: Select a valid choice. That choice is not one of the available choices.

2007-06-18 Thread Gabriel Farrell
On Jun 15, 3:13 pm, Gabriel Farrell <[EMAIL PROTECTED]> wrote: > I've just replaced the RadioSelect widget with CheckboxSelectMultiple > for one field in my view. Here's the relevant code: > > self.fields['patron_type'] = forms.ChoiceField(choices=(

Re: delete obsolete content type entries...

2007-06-18 Thread Gabriel Farrell
On May 7, 4:32 am, Jens Diemer <[EMAIL PROTECTED]> wrote: > That surprises me. Does nobody have the same problems? > Still nobody delete a model class? > > How to clean up the django tables? With phpMyAdmin? > I've just run into a similar issue when I removed an app from a project. After some at

CheckboxSelectMultiple error: Select a valid choice. That choice is not one of the available choices.

2007-06-15 Thread Gabriel Farrell
I've just replaced the RadioSelect widget with CheckboxSelectMultiple for one field in my view. Here's the relevant code: self.fields['patron_type'] = forms.ChoiceField(choices=( (pt.id, pt.name) for pt in patron_type_choices), widget=widgets.CheckboxSelec

Concatenate fields

2007-05-30 Thread Gabriel Laet
Hi, I have a question about filtering queries concatenating fields. I just saw in documentation the possibility to concatenate (AND, OR) sentences, but not concatenate table-fields to filter something. Is the Django DB-API able to do something like that? [SQL] WHERE lower(table1.label || ' ' ||

Re: building a menu dynamically based on user info

2007-04-29 Thread Marco Gabriel
Robin Percy schrieb: > Here's a simplified custom tag example using is_authenticated(): > > class TestTagNode(template.Node): > def render(self,context): > return "User is authenticated? %s" % > context['user'].is_authenticated() Thanks a lot, I was close, argh! :) --~--~-

Re: building a menu dynamically based on user info

2007-04-29 Thread Marco Gabriel
Robin Percy schrieb: > It sounds like you're trying to access the user as an attribute rather > than a key in your tag renderer. Make sure you're using the syntax > context['user'] as opposed to context.user. > I tried both, but if I use context['user'] I could not find a way to apply is_authe

building a menu dynamically based on user info

2007-04-29 Thread Marco Gabriel
Hi everyone, Scenario: I want to build a main menu with several entries. Some of the entries should only be displayed if the user is logged in (profile, settings), some only if it's an anonymous user (register, log in) and some entries should be always visible (home, ...). I tried it several

Feather in Django's cap

2006-12-01 Thread Gabriel Gunderson
on top of Python open source libraries such as the Django framework, smtpd.py mail service, and the wsgiref web server software." -- Gabriel Gunderson http://gundy.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Obsoleting by date

2006-11-14 Thread Gabriel Puliatti
ilter() those which have a date in the future, or get a boolean to be true after a certain date? -- The Public is merely a multiplied "me." -- Mark Twain Gabriel Puliatti [EMAIL PROTECTED] predius.org --~--~-~--~~~---~--~~ You receiv

Django site.

2006-11-13 Thread Gabriel Puliatti
Is the Django site down? I've been getting a (145) Connection timed out for a while now. -- The Public is merely a multiplied "me." -- Mark Twain Gabriel Puliatti [EMAIL PROTECTED] predius.org --~--~-~--~~~---~--~~ You receiv

Re: Nesh Thumbnail - Installation problem

2006-11-06 Thread Gabriel Puliatti
isn't class models.Meta back from before magic-removal? -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL PROTECTED] predius.org signature.asc Description: This is a digitally signed message part

Re: Mad SELECT with the admin view.

2006-10-15 Thread Gabriel Gunderson
fields in a model pointing to the same table? > I have a vague feeling I might have seen some messages about stuff like > that fly by but I could easily be wrong about that. I'll have to do some more searching with different key words. Any errors I found were PG specific, since that is

Re: Mad SELECT with the admin view.

2006-10-14 Thread Gabriel Gunderson
On 10/14/06, ggundy <[EMAIL PROTECTED]> wrote: > There must be some kind of spanning or looping going on as the SELECT > is full of this type of thing: "AND "country176"."world_region_id" = > "world_region177"."id" AND "shipper169"."message_type_id" = > "message_type178"."id" AND." I thought I wo

Font.

2006-09-28 Thread Gabriel Puliatti
I liked the Django font a lot. Does anyone know what font is used in the Django logo[1]? [1]http://media.djangoproject.com/img/site/hdr_logo.gif -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL

Re: Fast hosting for Django

2006-09-24 Thread Gabriel Puliatti
gt; clients. http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts A list on the wiki of the Django-capable webhosts. There are even two hosts which cater directly to Django users. -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabri

Re: ManytoMany uploading.

2006-09-21 Thread Gabriel Puliatti
On 9/21/06, Gabriel Puliatti <[EMAIL PROTECTED]> wrote: > Hm, I used that. I can print new_data.getlist('courses') and get the > list, but when I try to assign it to a variable for writing, I get > "'str' object has no attribute '_get_pk_v

Re: ManytoMany uploading.

2006-09-21 Thread Gabriel Puliatti
s no attribute '_get_pk_val'" However, this only happens when I do new_profile.save(). When I try to write what you said, it works and I can print, but the same happens when trying to save. -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture!

Re: ManytoMany uploading.

2006-09-21 Thread Gabriel Puliatti
'_get_pk_val'". -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL PROTECTED] predius.org signature.asc Description: This is a digitally signed message part

ManytoMany uploading.

2006-09-20 Thread Gabriel Puliatti
olence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL PROTECTED] predius.org signature.asc Description: This is a digitally signed message part

Re: ManytoMany filtering

2006-09-19 Thread Gabriel Puliatti
hanks a lot! -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL PROTECTED] predius.org signature.asc Description: This is a digitally signed message part

Re: ManytoMany filtering

2006-09-19 Thread Gabriel Puliatti
get no errors, but everything still passes, not filtering anything. Also, for "classesjoined". >>> print(classesjoined) -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL PROTECTED] p

ManytoMany filtering

2006-09-19 Thread Gabriel Puliatti
ed)" where classes joined is the ManytoMany in the student's model, I get "Error binding parameter 0 - probably unsupported type." Is there a way to fix this? -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gab

Re: Uploading.

2006-09-12 Thread Gabriel Puliatti
lemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti [EMAIL PROTECTED] predius.org signature.asc Description: This is a digitally signed message part

Re: Rails/Django comparison synopsis

2006-09-11 Thread Gabriel Puliatti
es. [1] http://wiki.rubyonrails.org/rails/pages/Framework+Performance -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti <[EMAIL PROTECTED]> predius.org signature.asc Description: This is a digitally signed message part

Uploading.

2006-09-11 Thread Gabriel Puliatti
I've uploaded a tutorial on uploading files into Django. I had some problems doing this when I started working on Django, and thought that perhaps people would appreciate it. I know that the files are not indented, blame Wordpress. It would be good to get some feedback, as I adapted it from my prog

Filtering by groups.

2006-09-01 Thread Gabriel Puliatti
lp is much appreciated at this point, considering I am a newbie. :P -- No violence, gentlemen -- no violence, I beg of you! Consider the furniture! -- Sherlock Holmes Gabriel Puliatti predius.org --~--~-~--~~~---~--~~ You received this message bec

Re: upload files to another server

2006-08-23 Thread Gabriel Puliatti
ve the media files. -- You can't get there from here. Gabriel Puliatti predius.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: How to user django upload file ?

2006-08-05 Thread Gabriel Puliatti
gner's music is better than it sounds. -- Mark Twain Gabriel Puliatti predius.org --~--~-~--~~~---~--~~ 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@google

Re: Novice problem with cookies

2006-08-03 Thread Gabriel Puliatti
> the lan of my client but I believe that it will not solve the problem > because I don´t have a domain name. > > Thanks in advance. > > > > > Can't you invent a domain name and add it into /etc/hosts of the client? -- Wagner's music is better than it sounds

Two entries in a Manipulator.

2006-08-02 Thread Gabriel Puliatti
error that is print()ed. {'togroup': ['This field is required.']} -- Wagner's music is better than it sounds. -- Mark Twain Gabriel Puliatti predius.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Uploading?

2006-08-02 Thread Gabriel Puliatti
Hey, I've been trying to do an uploading page, where users can upload a file, outside of the admin panel, of course. I follow http://www.djangoproject.com/documentation/forms/, but I end up getting "local variable 'errors' referenced before assignment" All the code is here: http://arrrt.googlec

<    1   2   3   4