Re: Standard python objects in request.session possible?

2007-12-15 Thread SmileyChris
On Dec 16, 2:13 pm, itpaul <[EMAIL PROTECTED]> wrote: > However, unlike the shell behaviour which lists and deletes messages, > the template lists and retains the messages resulting in them > displaying repeatedly on every page. Most likely, the session isn't getting saved.

Apologies

2007-12-15 Thread Hans Tovetjärn
Hello, nevermind my clumsiness, up way too late and copied and pasted the wrong link! Thank your for your kind responses though, will resubscribe at a later date when I got the hang of the basics. Have a nice day everyone! Regards, Hans Tovetjärn [EMAIL PROTECTED]

design for static/dynamic website

2007-12-15 Thread MrJogo
I'd like to migrate a currently static website to Django to add some dynamic features to it and I have some questions about how best to do that. The public site has mainly informational pages that can be static, but a few, like a members list, work better dynamic. The Django docs say that Django

Looking for jobs(check this out)Earn money now easily

2007-12-15 Thread nickola
This is my page,for those who are looking for jobs...see this link for details http://hojar.blogspot.com/ Start earning money now easily --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Unsubscribe

2007-12-15 Thread Hans Tovetjärn
Hello, please remove my subscription to this group. Thanks. Regards, Hans Tovetjärn [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Standard python objects in request.session possible?

2007-12-15 Thread Eduardo - IdNotFound
Hello again, It seems I hit the wrong spot. I went reading on __iter__ (which I admit I didn't know) and even though I'm not sure I understood it right, I guess your next() method probably _was_ being executed and it was all fine. So my new guess is that templates cannot modify objects (as in,

Re: How to modify every element in a list all at once

2007-12-15 Thread Ned Batchelder
for s in s2: s.price *= .9 --Ned. Greg wrote: > Hello, > I have the following list: > > [, )>, Small'>, )>, , )>, > , )>, , > )>] > > In my view I want to be able to modify the Price of each element. I > want to times the price of each element by .9. Here is my code that > creates the

Re: django widget combo box

2007-12-15 Thread [EMAIL PROTECTED]
On Dec 15, 1:40 am, mike <[EMAIL PROTECTED]> wrote: > http://code.djangoproject.com/wiki/AJAXWidgetComboBox > > Has anyone had any luck with this, I get to the template section and > cant get past the {% load formtags %} part. I found a formtags.py > from "Koders search" by googling and placed

Re: Standard python objects in request.session possible?

2007-12-15 Thread Eduardo - IdNotFound
Sounds like you're not updating/removing items from the MessageBox object, as I don't see where you are removing items from the list (I see no calls to MessageBox.next() being made). Alternatively, wouldn't the messaging system in the Authentication framework fit your needs? Your implementation

Re: import problems

2007-12-15 Thread Eric Abrahamsen
I think I'll take the nuclear option, and start over -- this has turned into a complete mess. Thanks, and sorry for wasting time... On Dec 16, 7:48 am, Nianbig <[EMAIL PROTECTED]> wrote: > Problem solved.. > > The problem seemed to be that I had two models called "events" in >

Re: Is it possible to create a related model from within another save() method?

2007-12-15 Thread James Bennett
On Dec 15, 2007 4:10 AM, Andrew <[EMAIL PROTECTED]> wrote: > I've implemented a generic "change" model for some of my models. > Ideally what I'd like is to be able to either mark or subclass a > model, and when changes are made to a specific field, a copy is saved > in the related "change" object

Re: Is it possible to create a related model from within another save() method?

2007-12-15 Thread Andrew
That's a good thought, but unfortunately that's not the way multiple inheritance works... only the first method in the chain gets called. On Dec 15, 6:54 am, Michael Elsdörfer <[EMAIL PROTECTED]> wrote: > > class Description(ChangeImplementor, models.Model): > > I might have a flaw in my logic,

Re: Stupid template question

2007-12-15 Thread rskm1
On Dec 14, 1:03 am, Steve Freitas <[EMAIL PROTECTED]> wrote: > Only, it doesn't work. It seems like . lookups > require the argument to be a literal, not a variable. Grindizer addresses your specific problem of enumerating key/value pairs in a template (piece of cake!), but if you still wanted

Standard python objects in request.session possible?

2007-12-15 Thread itpaul
This model works in the shell. It holds messages and pops items off as it iterates: class MessageBox: # also tried with (models.Model) def __init__(self, sort='neutral'): self.sort = sort self.messages = [] def __iter__(self): return self def next(self):

Re: import problems

2007-12-15 Thread Nianbig
Problem solved.. The problem seemed to be that I had two models called "events" in "events.event.views.events.index".. after renaming the one of the modules and deleteing a events.pyc-file that had been auto-created it works fine again! /Nianbig On Dec 16, 12:27 am, Nianbig <[EMAIL

Re: import problems

2007-12-15 Thread Nianbig
The weird thing is that I can reach from events.event.models import Events from a module outside "event".. events.user for example.. but not inside... This is what my urls.py looks like if that could be of any help: from django.conf.urls.defaults import * urlpatterns = patterns('',

Re: import problems

2007-12-15 Thread Nianbig
I´m having the same problem as well... Yes, permissions are set so that the web server has access to read the entire directory tree. /Nianbig On Dec 14, 3:53 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Are the permissions set so that the web server has access to read the entire > tree

How to modify every element in a list all at once

2007-12-15 Thread Greg
Hello, I have the following list: [, )>, , )>, , )>, , )>, , )>] In my view I want to be able to modify the Price of each element. I want to times the price of each element by .9. Here is my code that creates the above list: s2 = b.sandp.order_by('orderdisplay') I know that I can do

Re: Foreignkey / Relationship / Views

2007-12-15 Thread Empty
I'm not sure where you are getting the "u" from. It should be user, such as: AppointmentParticipant.objects.filter(participant_user__pk=user.id).select_related() You don't really need the depth in this case, unless you have more to your models I'm not seeing. The rest of it looks fine.

Re: Should not ModelObj.objects.get() have a .values method?

2007-12-15 Thread James Bennett
On Dec 15, 2007 9:35 AM, shabda <[EMAIL PROTECTED]> wrote: > Should not the object returned by .get() have > a .values method? No, because -- as the documentation clearly states -- get() returns a single model object. Only methods which return a QuerySet will have a values() method, because

Re: Foreignkey / Relationship / Views

2007-12-15 Thread [EMAIL PROTECTED]
Hello, Thanks for your answers which helped me a lot. Finally my models.py looks like: def appointments_all(request): user = request.user appointments = AppointmentParticipant.objects.filter(participant_user__pk=u.id).select_related(depth=2) return

Re: newforms: drop down datefield

2007-12-15 Thread l5x
Look here, I have similar problem, but unfortunately nobody was able to help me. I'm still waiting for answer, because it's important for me. http://groups.google.com/group/django-users/browse_thread/thread/d3b03b7fc5288ae0 Maybe it will iluminate you somehow :)

Re: i18n in modells

2007-12-15 Thread Magnus B
Tried this one? http://code.google.com/p/django-multilingual/ //Magnus On 15 Dec, 12:18, Julian <[EMAIL PROTECTED]> wrote: > Hi there, > > is there any tutorial/howto/example for a smart solution to bring i18n > into django models? > > i have an object A with a property name. this name should

Should not ModelObj.objects.get() have a .values method?

2007-12-15 Thread shabda
The call ModelObject.objects.filter(id = entry_id).values() works fine and the call to .values converts the model object to a dictionary. But the call ModelObject.objects.get(id = entry_id).values() fails as the object returned by get doesnot have a .values method. So to convert this to

newforms: drop down datefield

2007-12-15 Thread [EMAIL PROTECTED]
Hello, I'm using DateField from http://www.djangosnippets.org/snippets/399/ I have this code: data={ 'birthdate':user.birthdate, } form = BasicProfileEditForm(data) where birthdate is a Drop Down Date field. It doesn't work (can't set the date), has anyone a better Drop

Re: Is it possible to create a related model from within another save() method?

2007-12-15 Thread Michael Elsdörfer
> class Description(ChangeImplementor, models.Model): I might have a flaw in my logic, but if you were to switch the bases, inherit from models.Model first, and implemented a save() in ChangeImplementor, models.Model.save() should be called first, create the row, and by the time

Re: Django auth user relation to other connected objects

2007-12-15 Thread Ivan Sagalaev
Przemyslaw Wroblewski wrote: > When I started using django I create sth like this in my views: > > Somemodel.objects.filter(user = request.user) > > But I don't like that scheme, I just want to create something similar > to rails like: > > "current_user.somemodel.find_by_name('x')" You want

Play Online and Download Games Their Cheats Walkthrough and give me ur comments that how is this website.

2007-12-15 Thread [EMAIL PROTECTED]
Play 1)Online Games 2)Download Games http://GuruofGame.com 3)Cheats 4)Walk through --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

fastcgi and .htaccess

2007-12-15 Thread Rufman
Hey guys I have my django page on shared hosting with fastcgi. I followed this tutorial: http://www.djangoproject.com/documentation/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache this is my .htaccess file looks currently looks like: AddHandler fastcgi-script .fcgi

Django auth user relation to other connected objects

2007-12-15 Thread Przemyslaw Wroblewski
Hi, I've some rails experience before with several projects and I wonder how can I accomplish same behavior in django and if it's a good way to proceed. When I started using django I create sth like this in my views: Somemodel.objects.filter(user = request.user) But I don't like that scheme,

Re: get_absolute_url not working as expected

2007-12-15 Thread Florian Lindner
Am 15.12.2007 um 05:03 schrieb Alex Koshelev: > > 1) May be string is needed As I said, even when I return a constant string (return "foo") it changing nothing. > > 2) Absolute url not uri. So domain name is not needed. > > On 15 дек, 01:29, Florian Lindner <[EMAIL PROTECTED]> wrote: >>

i18n in modells

2007-12-15 Thread Julian
Hi there, is there any tutorial/howto/example for a smart solution to bring i18n into django models? i have an object A with a property name. this name should be available in any languages specified in settings.LANGUAGES. until now i have an I18NNameValueField with the properities languagecode

Re: Dynamic Choicefield

2007-12-15 Thread pinco
pk, thank you very much for your hint, now everything works ok. :-) On 9 Dic, 18:41, pk <[EMAIL PROTECTED]> wrote: > This is a pretty common problem. Each form object gets instantiated as > you need them. > So in your POST handling, you need to instantiate the form with the > same product

Is it possible to create a related model from within another save() method?

2007-12-15 Thread Andrew
I've implemented a generic "change" model for some of my models. Ideally what I'd like is to be able to either mark or subclass a model, and when changes are made to a specific field, a copy is saved in the related "change" object stack -- such that when the post_save signal is sent out from my

Re: ModelForms widget attrs

2007-12-15 Thread stuntgoat
Nevermind; I got it: class Disco(ModelForm): pickup_lines = forms.ModelMultipleChoiceField(required=True, queryset=WittyThings.objects.all(), \ widget=forms.SelectMultiple(attrs={'size': '10'}) ) class Meta: model = Dance -sg On Dec 15, 8:40 am, stuntgoat <[EMAIL

ModelForms widget attrs

2007-12-15 Thread stuntgoat
Can I change a ModelForms widget attrs? My model form: class Disco(ModelForm): class Meta: model = Dance I want to change the form widget of pickup_lines which is pickup_lines = models.ManyToManyField(WittyThings) in models.py I would like to edit this model form widget like: