assign dynamic value to form field in django admin

2009-09-25 Thread Joru
Hi I need to assign one form field dynamically inside django admin when user change value in select box class One(models.Model): name = models.CharField(max_length=200) code = models.CharField(max_length=100) class Two(models.Model): two_name = models.CharField(max_length=200)

name error not defined in models

2009-09-01 Thread Joru
Hi I got name error in my models when using models.ManyToManyField Here are my models class Ank(models.Model): route = models.ManyToManyField(Dek) intercity = models.BooleanField() class Dek(models.Model): ank = models.ManyToManyField(Ank) How come I got "NameError: name 'Dek' is

django queryset based on when data created

2009-08-05 Thread Joru
Everytime I edit some data, the data order in queryset changed into the newest edited Is it posible to get queryset that ordered based when the data created without having to add creation date for sorting purpose --~--~-~--~~~---~--~~ You received this message

Re: how to make field in admin edit view sortable

2009-07-04 Thread Joru
Thanks Karen this work perfectly On Jul 3, 10:05 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Thu, Jul 2, 2009 at 11:52 PM, Joru <avenp...@gmail.com> wrote: > > > is this posible? > > Maybe. > > > > > anyone have solution for this? &g

Re: how to make field in admin edit view sortable

2009-07-02 Thread Joru
is this posible? anyone have solution for this? On Jul 2, 4:54 pm, Joru <avenp...@gmail.com> wrote: > I have following class > > class ProfileAdmin(UserAdmin): >     list_display = ('username', 'email', 'first_name', 'last_name', > 'is_staff', 'last_login', 'date_joined', '

how to make field in admin edit view sortable

2009-07-02 Thread Joru
I have following class class ProfileAdmin(UserAdmin): list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'last_login', 'date_joined', 'city') def city (self,val): return str(val.profile.city) I need city to be sortable How can I do that?

add other field for django admin user

2009-06-29 Thread Joru
Hi, Suppose I have UserPref with attribute phone and detail Is it possible to add UserPref.phone and UserPref.detil in edit form in django user admin? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: regex problem in django

2009-06-29 Thread Joru
Still doesn't work even I remove wrap function :( On Jun 29, 7:35 pm, James Gregory <james@gmail.com> wrote: > On Jun 29, 1:05 pm, Joru <avenp...@gmail.com> wrote: > > > I'm sorry for my typo > > the string var suppose to be like this > > str = "wr

Re: regex problem in django

2009-06-29 Thread Joru
ex doesn't work well if i called it from views.py of my django app So the problem that I faced is that, how come when using django/python shell. my regex work but not if I put in on my views.py Any hint? On Jun 29, 5:49 pm, James Gregory <james@gmail.com> wrote: > On Jun 29, 11:19 a

Re: regex problem in django

2009-06-29 Thread Joru
ah, I just want to match in the end of line only so change the rule "wr$" would get what I want? On Jun 29, 4:56 pm, James Gregory <james@gmail.com> wrote: > On Jun 29, 10:49 am, Joru <avenp...@gmail.com> wrote: > > > > > I mean None not null >

Re: regex problem in django

2009-06-29 Thread Joru
regory <james@gmail.com> wrote: > On Jun 29, 10:05 am, Joru <avenp...@gmail.com> wrote: > > > > > I still can't solve this > > Anyone had answer on this? > > > On Jun 26, 7:39 pm, Joru <avenp...@gmail.com> wrote: > > > > Hi, > > &

Re: regex problem in django

2009-06-29 Thread Joru
I still can't solve this Anyone had answer on this? On Jun 26, 7:39 pm, Joru <avenp...@gmail.com> wrote: > Hi, > > I experience some weirdness regarding usingregexwith django > I have following function in utils.py > > from django.utils.text import wrap > import re >

regex problem in django

2009-06-26 Thread Joru
Hi, I experience some weirdness regarding using regex with django I have following function in utils.py from django.utils.text import wrap import re str = "wr: \n one bunny \n two bunny \n wr: three bunny \n def do_regex(text): lines = wrap(text, 55).split('\n') for i, line in

Re: passing template variable to templatetags

2009-06-21 Thread Joru
Is it possible to resolve tag value(in this is group.id) inside templatetags(tag_model(parser,token)) function without having it render in subclass of django.template.Node? Please give me some solution On Jun 20, 4:32 pm, Joru <avenp...@gmail.com> wrote: > Hi, > > Suppose I h

passing template variable to templatetags

2009-06-20 Thread Joru
Hi, Suppose I had templatetags {% tag_model tags.tag as tags with group=group.id %) in my templatetags I define tag_model as a follow def tag_model(parser, token): bits = token.contents.split() len_bits = len(bits) name, value = bits[i].split('=')