jsonpickle
Hi, I downloaded and installed on windows Jsonpickle In normal python script everything works fine (import jsonpickle) but I dont know how to use it in my django app (in views import jsonpickle doesnt work) - no module named jsonpickle thanks for 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 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: how to achieve functionality of asynchronous popups
Thanks, That is exactly the answer I needed. --~--~-~--~~~---~--~~ 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 to achieve functionality of asynchronous popups
Hello, I would like to implement functionality described below. Lets say that There is a Django application in which each user can create records and insert them into Database (for example record containing one text column). Many users can be logged in the application at the same time. One users created record which was inserted into the database. Than another user edited it from application and saved. What I want to achieve is sort of popup which will appear on the first user screan informing him that record created by him was changed. The logic described above is just a sample. What I need is to know how to pass some information to logged user and show it in popup or sth similar. For example in Gmail when someone starts chatting to you there is a small popup in the bottom corner. Maybe article or tutorial on the web ? thank very much for 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-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: navigation
Up Up On Oct 28, 11:42 am, elminio <wgruszczyn...@gmail.com> wrote: > Hi, > > I use generic view on updating objects. How to create button with > cancel that will always redirect me to the previous page ? > > 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 -~--~~~~--~~--~--~---
navigation
Hi, I use generic view on updating objects. How to create button with cancel that will always redirect me to the previous page ? 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 -~--~~~~--~~--~--~---
ajax problem
Hello, The situation is that I have a div to which I want to dynamically load forms for update create etc of my models. I use generic forms. And the problem is that when I use javascript with jQuery : key is already defined: $("#div_nontetn").load("/model/"+ key + "/update/", {object_id: key}, function(){ }); It doesnt render the site in which is form to fill but automaticaly submits empty form and redirect to object_detal. What am I doing wrong ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
authorization
Hi, By admin I can choose what users can do with model objects. And what about certain pages. Do I have to write if in everyone view method (to check is current user may access given view ? Or is there any built in tool that makes it possible to restrict access to given pages. thanks for 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-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: new permission
hi, It didnt help :/ On Oct 9, 10:33 am, "Bogdan I. Bursuc" <bogdanbursu...@gmail.com> wrote: > Try to delete the auth_permissions table the sync db > see if it helps > > On Fri, 2009-10-09 at 01:29 -0700,elminiowrote: > > Up Up > > > On Oct 8, 12:10 pm,elminio<wgruszczyn...@gmail.com> wrote: > > > Hi, > > > I've extended my model with new permission. > > > > class Meta: > > > permissions = ( > > > ("total", "total"), > > > ) > > > > After that I mafe manage.py syncdb. But after that when I wanted to > > > add user new privilage just created there wasn't it in admin panel > > > where you can choose permissions add and remove from user. > > > > thanks for 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-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 -~--~~~~--~~--~--~---
server performance
Hi, I'm going to take my project on production. Now I'm looking for good hosting service and I would like to know what are django requirements. I mean what CPU, RAM, would be enough form website with more than 2000 visitors per day. And for website with visitors sth like 1000 per day. Maybe any virtual server hosting thanks for 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-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: new permission
Up Up On Oct 8, 12:10 pm, elminio <wgruszczyn...@gmail.com> wrote: > Hi, > I've extended my model with new permission. > > class Meta: > permissions = ( > ("total", "total"), > ) > > After that I mafe manage.py syncdb. But after that when I wanted to > add user new privilage just created there wasn't it in admin panel > where you can choose permissions add and remove from user. > > thanks for 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-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 -~--~~~~--~~--~--~---
new permission
Hi, I've extended my model with new permission. class Meta: permissions = ( ("total", "total"), ) After that I mafe manage.py syncdb. But after that when I wanted to add user new privilage just created there wasn't it in admin panel where you can choose permissions add and remove from user. thanks for 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-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: custom permission in admin models
not exactly, for example I want to make custom permission which enables user to change one field in model but only to 5 letter length word while other users may change that field to 6 letters length word. Thats sily example but in some cases it may be useful. On Oct 6, 10:19 am, "Bogdan I. Bursuc" <bogdanbursu...@gmail.com> wrote: > i think you want to create a group. > > On Tue, 2009-10-06 at 01:05 -0700, elminio wrote: > > Hi, > > In admin Panel I can choose groups and give them specified > > permissions. For example > > > admin | log entry | can add log entry > > > And I would like to create my own type of permission which for example > > is called all and gives to the specified user permission to do > > whatever he likes, and other permission moderator which gives for > > example only half. What I mean is there any way to write custom > > permission types. > > > thanks for response > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
case sensitivity in admin search
Hi, How to ignore case sensitivity in admin search box ? In model I have one search field set but case sensitivity isn't ignored 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 -~--~~~~--~~--~--~---
custom permission in admin models
Hi, In admin Panel I can choose groups and give them specified permissions. For example admin | log entry | can add log entry And I would like to create my own type of permission which for example is called all and gives to the specified user permission to do whatever he likes, and other permission moderator which gives for example only half. What I mean is there any way to write custom permission types. thanks for response --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
understsanding views
Hello, I assume that each view should return Httpresponse. What when I just want to execute function which updates my databes and doesnt redirect anywhere ? thanks for reply --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
list_filter
Hello I have model like: class MyModelA(models.Model): number = models.IntegerField() class MyModel(models.Model): my_model_a = models.ForeignKey(MyModelA) other_field = other data ... and now in admin: class MyModelAdmin(admin.ModelAdmin): list_filter = ("my_model_a") it filters by my_model_a and it is ok. But is it possible to filter by my_model_a.number (sth like that) ?? --~--~-~--~~~---~--~~ 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: template syntax
You don't understand me. WQhat I want to achieve is to use student.id as a key in dictionary (Im talking abous template) If I use: {% for student in students %} ... do sth ... {{dictionary.student.id }} {% endfor %} using dictionary.1 works using dictionary.student.id doesnt work because there is no such key like student in dictionary. What can I do to convert student.id to value and pass it like for example dictionary. (student.id) if in this iteration student.id = 5 then i want to have {{ dictionary. 5 }} thats all On Aug 18, 6:15 pm, mettwoch <mettw...@pt.lu> wrote: > See this: > > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for > > There's an example of iterating over key, value pairs > > Marc > > On Aug 18, 5:48 pm, elminio <wgruszczyn...@gmail.com> wrote: > > > I iterate through all students and have distionary containing students > > ids as key and for example grade as a value. I pass this dictionary to > > the view and then while iterating through all students I though that > > it would be simple to get appropriate value for current student. I > > dont know how I could make it simplier in template :/ If You think so > > maybe any ideas? but please with sample code > > --~--~-~--~~~---~--~~ 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: template syntax
sorry: I pass this dictionary to the TEMPLATE --~--~-~--~~~---~--~~ 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: template syntax
I iterate through all students and have distionary containing students ids as key and for example grade as a value. I pass this dictionary to the view and then while iterating through all students I though that it would be simple to get appropriate value for current student. I dont know how I could make it simplier in template :/ If You think so maybe any ideas? but please with sample code --~--~-~--~~~---~--~~ 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: template syntax
Thanks for such a quick reply and what is i iterate through for example students {% for student in students %} {{ dictionary.student.id }} {% endfor %} I want to have student.id as a key and in the way I did it above it doesnt work because dicttionary wants student as a key :) thanks for 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-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 -~--~~~~--~~--~--~---
template syntax
Hi, Im passing to the template dictionary and I would like to get by key to the value of that dictionary and if the key doesnt exist in it insert blank field into html thank You very much for 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-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 -~--~~~~--~~--~--~---
serializing
Hello, I have problem with serialization of querysets. I use methos: json = serializers.serialize('json', [Grade.objects.get(pk=pk)]) return HttpResponse(json, content_type='application/json; charset= %s' % settings.DEFAULT_CHARSET) And I get this error: 'Grade' object has no attribute 'get_absolute_url' Why do I ahve to implement get_absolute_url ?? When I use simplejson.dumps([Grade.objects.get(pk=pk)]) I get error: is not JSON serializable thanks for 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-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: logic in templates
Thanks, And what if I want to use another thiord or maybe even fourth item customers sellers products Im new in python so thanks for help On Aug 12, 11:17 am, David Zhou <da...@nodnod.net> wrote: > The easiest way is probably moving that list to the view. For example > > customers = Customer.objects... > sellers = Seller.objects... > > filtered_list = [pair for pair in zip(sellers, customers) if > pair[0].customer_id == pair[1].id] > > Then pass filtered_list into the template context. Inside the > template, you could do: > > (Assuming Django >= 1.1) > > {% for seller, customer in filtered_list %} > {{ seller.name }} {{ customer.name }} > {% empty %} > No customers. > {% endfor %} > > -- dz > > On Wed, Aug 12, 2009 at 5:06 AM, elminio<wgruszczyn...@gmail.com> wrote: > > > Hello, > > > Common task in template is doing for loop end inserting into html some > > elements. > > > for example > > > 1: {% for seller in sellers %} > > 2: {% for customer in customers %} > > 3: {% ifequal seller.customer_id customer.id %} > > 4: {{ seller.name }} {{ customer.name }} > > 5: {% endifequal %} > > 6: {% endfor %} > > 7: {% endfor %} > > > Thats clear. > > > Now I would like to know when the loop is over and system didnt't find > > customer for seller (line 3). And in this case insert no customers > p>. > > > If it shouldnt be done in template how can I inject logic from python > > file ? > > > thanks for 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-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 -~--~~~~--~~--~--~---
logic in templates
Hello, Common task in template is doing for loop end inserting into html some elements. for example 1: {% for seller in sellers %} 2:{% for customer in customers %} 3:{% ifequal seller.customer_id customer.id %} 4:{{ seller.name }} {{ customer.name }} 5:{% endifequal %} 6:{% endfor %} 7: {% endfor %} Thats clear. Now I would like to know when the loop is over and system didnt't find customer for seller (line 3). And in this case insert no customers. If it shouldnt be done in template how can I inject logic from python file ? thanks for 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-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 -~--~~~~--~~--~--~---
connectiong querysets
Hello, Is it possiblo to merge Querystets into one big Queryset? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
dynamic inserting items to template
Hello, Is it possible to insert to the template for example 10 checkboxes I know syntax of iterating through objects in list and do some task for each item but Im interested in normal for loop like for i in xrang(10): insert checkbox thanks for reply --~--~-~--~~~---~--~~ 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: many to many model
Hi, tahnks for reply I added additional ManyToManyfield to one table and admin panel looks ok but in fact even using syncdb new intermediate table wasn't created. Is there anything else I should do ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
many to many model
Hello, My problem is that I have (for example), a model teacher - subject many to many. So that I made additional table named teacherSubject with both ids. Now I would like to have an opportunity to add subjects to Teachers in admin panel but no by id of the subject but by name. Now according to tutorial inline section looks like this: class SubjectInline(admin.StackedInline): model = TeacherSubject extra = 3 class TeacherAdmin(admin.ModelAdmin): fieldsets = [ ('Data', {'fields': ['firstName', 'surrName']}) ] inlines = [SubjectInline] But like I wrote it gives me possibility to add subjects by ids. Is there any easy way to map ids to names ? thanks for 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-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 -~--~~~~--~~--~--~---