Re: Website Documentation Search broken?

2011-12-18 Thread kenneth gonsalves
On Sat, 2011-12-17 at 12:51 -0600, Jacob Kaplan-Moss wrote:
> On Sat, Dec 17, 2011 at 12:30 AM, kenneth gonsalves
>  wrote:
> > thanks for the info - the search *has* improved, for example a
> search
> > for get_FOO_display used to fail, it now succeeds. But I still need
> > ddg's site search for multiword searches.
> 
> Can you be a bit more specific? If there's a bug I'd like to fix it,
> but I'm not having any issues with "multiword searches"; for example:
> 
> 
https://docs.djangoproject.com/search/?q=typed+choice+field=5
https://docs.djangoproject.com/search/?q=choices+display=5

what happens here is that the search returns all the results for each
individual word - not the combination of words. Compare with ddg:

http://duckduckgo.com/?q=site%3Adocs.djangoproject.com+typed+choice
+field
http://duckduckgo.com/?q=site%3Adocs.djangoproject.com+choices+display

-- 
regards
Kenneth Gonsalves

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How do I prevent messages getting cached?

2011-12-18 Thread Nathan Geffen
Hi

I am using per-view caching in version 1.3 and would prefer to avoid
caching in my templates as far as possible. However, I've hit a snag.
If the messaging framework generates a message for a cached view, one
of two things happen:

1. If the page is not yet in cache, the page gets cached with the
message in it. So next time a user goes to the page, they get an old
message.

2. If the page is already in cache, the message isn't displayed.

Is there a simple way to address this? Perhaps something I can put in
a vary_on_headers decoration? Or is there a simple way to tell Django
to put the message into a query string so that the page with the
message is cached separately from the page without the message?

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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: auth.login function not working as expected

2011-12-18 Thread Abraham Yusuf
Hi all,
I found a solution to the problem so i taught i'd let you know. It was really 
an oversight, my login view is like so:

@return_json
def login(request)

In the decorator i was ripping off the raw post data and passing it to the view 
as arguments while the view itself only takes the request arg. Sorry for 
posting it anyway.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ListField Implementation

2011-12-18 Thread Roy McElmurry IV
One thing I found very useful for myself was building a ListField and
ListInput widget that built lists of forms. This widget comes with a
button to dynamically generate new elements to the list. The code I
wrote uses only built-in packages and existing django code. I think
this could a very popular field type. Does anyone think there would be
much interest in incorporating such a thing into django? I can give
more details and prepare a demo if anyone is interested. If so, I
would really love to start contributing the code to the project.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: auth.login function not working as expected

2011-12-18 Thread Jhonny5
2011/12/18 Jhonny5 

> Hi,
> 2011/12/18 Abraham Yusuf 
>
>> Hi all,
>> I'm trying to login a user using django's authentication backend with the
>> following:
>> user=auth.authenticate(userid,pass)
>> if user:
>>   if user.is_active:
>>  auth.login(request,user)
>> I am getting TypeError login() takes exactly 1 argument (2 given). I've
>> checked the docs and i can't find any problem there. Pls any help will be
>> appreciated. Am using django 1.3.1, python 2.7 on ubuntu 11.04.
>>
>>
> Do you have maybe another function called login(one_argument).
>
>
Just realize it's from auth object, but i had same problem with conflicts
on that... check that way out maybe.



Cheers,
> J.
>
>
>>  --
>> 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...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> talueee.com
>
> Linux User #236965 (counter.li.org)
> key: http://talueee.com/gpg/jhonny5.asc
> Po fueno, po fale, po malegro.
>
>


-- 
talueee.com

Linux User #236965 (counter.li.org)
key: http://talueee.com/gpg/jhonny5.asc
Po fueno, po fale, po malegro.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: auth.login function not working as expected

2011-12-18 Thread Jhonny5
Hi,
2011/12/18 Abraham Yusuf 

> Hi all,
> I'm trying to login a user using django's authentication backend with the
> following:
> user=auth.authenticate(userid,pass)
> if user:
>   if user.is_active:
>  auth.login(request,user)
> I am getting TypeError login() takes exactly 1 argument (2 given). I've
> checked the docs and i can't find any problem there. Pls any help will be
> appreciated. Am using django 1.3.1, python 2.7 on ubuntu 11.04.
>
>
Do you have maybe another function called login(one_argument).

Cheers,
J.


> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
talueee.com

Linux User #236965 (counter.li.org)
key: http://talueee.com/gpg/jhonny5.asc
Po fueno, po fale, po malegro.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



auth.login function not working as expected

2011-12-18 Thread Abraham Yusuf
Hi all,
I'm trying to login a user using django's authentication backend with the 
following:
user=auth.authenticate(userid,pass)
if user:
   if user.is_active:
  auth.login(request,user)
I am getting TypeError login() takes exactly 1 argument (2 given). I've checked 
the docs and i can't find any problem there. Pls any help will be appreciated. 
Am using django 1.3.1, python 2.7 on ubuntu 11.04.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Organizing/Loading components on a home page using python

2011-12-18 Thread Kristian Øllegaard
Hi Waqar,

Check out django-cms  - you are probably 
looking for a CMS. There are other django based CMSes as well, but 
personally I only had experience with the django-cms, which worked great 
for my usecases. Here you can make cms plugins that you can rearrange 
directly on the page itself, using a toolbar provided by the CMS.

Good luck with your project.

Regards,

Kristian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/D4DCGfNmQpEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



change charfield choices from within a ModelForm

2011-12-18 Thread brian
How do I change the CharField choices from within a ModelForm?

Here is  the stripped down version of what I have:
-
class myModel(models.Model):
test = models.CharField(max_length=3,
verbose_name='test choices',
 )

class myForm( ModelForm ):

class Meta:
model = myModel

-


One thing I tried was this but the choices didn't get added to the
form.  Note: I haven't ran this version of the code.
---
class myModel(models.Model):
test = models.CharField(max_length=3,
verbose_name='test choices',
 )

def changeChoices(self, choiceTuple):
field = self._meta.get_field_by_name( 'test' )
[0]
field._choices = choiceTuple

class myForm( ModelForm ):
def __init__(self, *args, **kwargs):

super(myForm, self).__init__(*args, **kwargs)

choices = (
('a', 'choice a'),
('b', 'choice b'),
)

self.instance.changeChoices(choices)

class Meta:
model =
myModel

--

One thing I thought about was passing a parameter to the model init
but I'm not sure how to do that.  I found this article that would seem
to work if I could figure out how to send params to the model's init:
http://blog.yawd.eu/2011/allow-lazy-dynamic-choices-djangos-model-fields/

Another thing I thought about was modifying the field in the form.  In
the forms init do something like self.fields[ 'test' ]... but I'm not
sure where to access the choices.

Brian

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Organizing/Loading components on a home page using python

2011-12-18 Thread creecode
Hello Waqar,

It sounds like you are looking for something like Drupal. Although I've not 
used it myself I think Drupal has an architecture like you describe.

Django is a web framework it is not a website builder with auto-configuring 
modules.

Don't get me wrong.  Django is a fantastic web framework and you could can 
build almost anything you desire.  It's just a bit lower level tool than 
what you describe you are looking for.

Toodle-looo...
creecode

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/3aGC-PKPdDoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Organizing/Loading components on a home page using python

2011-12-18 Thread Waqar Azeem
I don't know from where to start to ask this question.

I need to create a HOME page with multiple components, like • News •
Products • Forum Topic • Ads and so on.

The little knowledge that i have accumulated on Django forced me to
start using the templates, because I didn't find small, reusable and
largely independent components creation support in Django that could
render itself. Or even simple web-controls that could be managed and
extend from python code for example how can I create my Calendar
control and more important how can I extend it.

Due to my limited study so far, I started to slice the home page into
multiple templates derived from the base.html; and put some views
function for each derived template.

Now I am puzzled that when a user hits the home page then, HOW should
I start the sequence of the components loading one by one in a view
function. how should I organize the code.

-- Waqar

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



searching for a django developer for an online gig

2011-12-18 Thread Mo Mughrabi
hi,

am looking for a good django developer to help finish a site, we are a team
of two and we would like to increase the work force. Must have strong
communication skills, good knowledge with html, css and javascripting
(jquery).

We are using amazon was, celery, rabbitmq and social networking
integration. He/she must be comfortable designing html pages as part of
some deliveries.

Contact me back for more details,

regards,

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.