Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Landy Chapman
>From what I can tell it's not your fault. have a look at: http://code.google.com/p/slickgrid/issues/detail?id=19 fix might be here http://drupal.org/node/1094054#comment-4825024 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: How to avoid repeated "context_instance = RequestContext(request)" args when rendering?

2011-08-16 Thread Jirka Vejrazka
>> > ... I'm hoping some standard solution >> > already exists.)  Sorry to be so long winded. Hi there, in older Django versions, you can use direct_to_template from generic views to automatically use RequestContext. I'm using it to save a line or two per view. Not a magic solution, but

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Adam Zedan
okay going to error ansole of firefox here is what i got Error: Slick is not defined Source File: http://127.0.0.1:8000/db/ Line: 37 which is : grid = new Slick.Grid("#myGrid", data, columns, options); and the warnings are Security Error: Content at http://127.0.0.1:8000/db/ may not load or

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Jani Tiainen
Hi, You can't (and you shouldn't) use file urls in your original source but should let the Django handle urls to them for you. There is dedicated part about static file serving in documentation [1][2]. And if you really think that you're deploying your project to somewhere you really expect

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Adam Zedan
Thanks.. that what i just came across. It seems firefox doesnt let u load static files http://rubenlaguna.com/wp/2007/04/20/firefox-and-file-windows-unc-paths/ On Tue, Aug 16, 2011 at 11:43 AM, Jani Tiainen wrote: > Hi, > > You can't (and you shouldn't) use file urls in your

Weird hyperlink issue with Office and Django authentication

2011-08-16 Thread Michel30
I have made a CMS-like application to store and retrieve documents using Django 1.3, mysql and Apache. One requirement was that only authenticated users could use it and that after closing the browser the session should be expired. So, I implemented an LDAP authentication backend, set the

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Adam Zedan
So what do u suggest ?? will that also solve the firefox security issue. currenty i am just using the following html code Demo On Aug 16, 11:58 am, Adam Zedan wrote: > Thanks.. that what i just

Re: Weird hyperlink issue with Office and Django authentication

2011-08-16 Thread Michel30
Addidtionally I found this kb article that I believe describes what is going on: http://support.microsoft.com/kb/899927/en-us On Aug 16, 8:59 am, Michel30 wrote: > I have made a CMS-like application to store and retrieve documents > using Django 1.3, mysql and Apache. > >

model save question

2011-08-16 Thread Mike Dewhirst
When using save() in a model, what is the difference between ... save(self, force_insert=False, force_update=False) or save(self, force_insert=False, force_update=False, **kwargs) # whatever super(Xyz, self).save(force_insert, force_update) or super(Xyz, self).save(force_insert,

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Landy Chapman
Jani Tiainen is right > > You can't (and you shouldn't) use file urls in your original source but > > should let the Django handle urls to them for you. ..or hard-code relative links in your templates. I was thinking about the file:/// un your urls; not the best idea but they are absolute and

Re: Weird hyperlink issue with Office and Django authentication

2011-08-16 Thread Michel30
Hmm the workaround MS suggests actually works, so I have a workaround :-) But understanding why Django's authentication backend doesn't support this would be good On Aug 16, 9:10 am, Michel30 wrote: > Addidtionally I found this kb article that I believe describes what is

Re: model save question

2011-08-16 Thread Daniel Roseman
On Tuesday, 16 August 2011 08:21:24 UTC+1, Mike Dewhirst wrote: > > When using save() in a model, what is the difference between ... > > save(self, force_insert=False, force_update=False) or > save(self, force_insert=False, force_update=False, **kwargs) > # whatever > super(Xyz,

Re: model save question

2011-08-16 Thread Mike Dewhirst
Thanks DR Mike On 16/08/2011 6:10pm, Daniel Roseman wrote: On Tuesday, 16 August 2011 08:21:24 UTC+1, Mike Dewhirst wrote: When using save() in a model, what is the difference between ... save(self, force_insert=False, force_update=False) or save(self, force_insert=False,

[ANN]: FeinCMS v1.4.1 final

2011-08-16 Thread Matthias Kestenholz
Hello everyone I failed big time when creating the v1.4.0 release and created the package from the wrong version... Anyway, we're back on track now. v1.4.1 is available at the usual places with the contents v1.4.0 should have had. I'm sorry for any problems caused by this blunder. Best

Re: Using {% url somenamedview %} in a custom page extending admin templates

2011-08-16 Thread Tom Evans
On Mon, Aug 15, 2011 at 8:37 PM, Thomas Weholt wrote: > My urls.py for my app: > > urlpatterns = patterns('', >    url(r'^geocoding/$', geocoding, name='geocoding'), > ) > > I've extended the change_list.html template based on the standard > change_list.html and added

Re: Convert dictionaries to django model (recursively)

2011-08-16 Thread Masklinn
On 2011-08-15, at 18:11 , Jacco77 wrote: > > How can I get django to understand that I want it to convert my > dictionary recursively? Then I want to full save it (the whole blob) > recursively, that is fields that are pointing to other models should > be saved first. The only piece of Django I

Re: showing an attribute of a foreign key in admin

2011-08-16 Thread i...@webbricks.co.uk
thanks tracy, i'd tried something very similar to Daniels method and failed, but your code worked first time. On Aug 15, 12:36 pm, Karen Tracey wrote: > On Mon, Aug 15, 2011 at 4:51 AM, i...@webbricks.co.uk > wrote: > > > > > > > > > > > > > I want to

Re: Use object (User and custom object) in a form

2011-08-16 Thread nicolas HERSOG
Oh I see, I've just modified my code with new import but i still have problem to submit my form. I don t have any errors but i can't pass the form.is_valid(). It's my first form so i don t know how to do it. Can you (again) help me ? Here it's my forms.py : from django import forms from

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Konstantin Sushenko
you do not see anything because the style on your root element is set to "display:none" and the browser does not run scripts because they are loaded from local URLs. as it says: it is a insecure to execute scripts from local URLs. suppose you publish this page on your production server, where

Re: Use object (User and custom object) in a form

2011-08-16 Thread Tom Evans
On Tue, Aug 16, 2011 at 12:39 PM, nicolas HERSOG wrote: > Oh I see, > I've just modified my code with new import but i still have problem to > submit my form. I don t have any errors but i can't pass the > form.is_valid(). > It's my first form so i don t know how to do it. Can

Re: Weird hyperlink issue with Office and Django authentication

2011-08-16 Thread Konstantin Sushenko
as the article says, their sessions are independent of these used by the web server. the cookies are not shared between office sessions and web sessions. I think django has nothing to do with it. On Aug 16, 4:04 am, Michel30 wrote: > Hmm the workaround MS suggests actually

M2M with self throught int. table, how to access related items?

2011-08-16 Thread Yaşar Arabacı
Hi, I am not a django guru (yet) and I am having what I would guess a trivial django question. Here is my table setup stripped: class Post(models.Model): relevancy = models.ManyToManyField("self",through="Traffic",symmetrical=False,related_name="relevant",blank=True) class

Re: model save question

2011-08-16 Thread Yaşar Arabacı
Absence of **kwargs would cause problems if for example save method is called with "using" keyword argument. You could either list all the available keyword arguments or use **kwargs. By the way, is there any other kwarg for save? 2011/8/16 Mike Dewhirst > When using

search with a optional value

2011-08-16 Thread john
hi, i have a form with few fields as optional,i.e can be left blank, i want to search my db for values i receive from this form, how should i go on about writing my filters when some of values can be " ". any reference is kindly appreciated -- You received this message because you are subscribed

Re: Weird hyperlink issue with Office and Django authentication

2011-08-16 Thread Michel30
Yes I agree, but if I understand it right then the article suggests that the issue originates from the single sign-on mechanism, in this case the Django authentication backend. This should be smart enough to handle the multiple sessions. Anyway I had a hard time finding anything related on the

httpresponse creates file in /tmp

2011-08-16 Thread sebastiaan
Hi, currently I'm working on an application that serves PDF files using HttpResponse: f = open( pdfFileName, 'r' ) response = http.HttpResponse( f.read(), mimetype='application/ pdf' ) response['Content-Disposition'] = 'attachment; filename=%s' % pdfFileName

Re: Django-Registration, How can a beginner work with this 3rd party App?

2011-08-16 Thread shacker
See also: django-profiles: The Missing Manual http://birdhouse.org/blog/2009/06/27/django-profiles/ (django-profiles and django-registration are close cousins; I always use them in combination with one another). ./s -- You received this message because you are subscribed to the Google Groups

Re: httpresponse creates file in /tmp

2011-08-16 Thread Tom Evans
On Tue, Aug 16, 2011 at 3:58 PM, sebastiaan wrote: > Hi, > > currently I'm working on an application that serves PDF files using > HttpResponse: > >        f = open( pdfFileName, 'r' ) > >        response = http.HttpResponse( f.read(), mimetype='application/ > pdf' ) >  

Re: help error in form usage

2011-08-16 Thread Phang Mulianto
hi anyone can help me... On Mon, Aug 15, 2011 at 12:39 PM, Phang Mulianto wrote: > Hi Daniel, > > i change it to instance, but still got other errors : > > > def myadmin_change_post(request, > template_name='blog/admin/change_post.html'): > try: > id=

Re: help error in form usage

2011-08-16 Thread Tom Evans
Your form is not a model form, and so you cannot pass instance=post. Since it is just a regular form, you should pass a dictionary of values, with the keys of the dictionary being the names of the fields. If the form is representing a model, you should be using a model form.

Re: help error in form usage

2011-08-16 Thread Phang Mulianto
Oh i see.. i read the manual, the django book, no such information about that.. oh my..better update the manual there.. thanks for your quick explanation then, i think not a good way to manualy assign a dictionarry to the form, not like in the documentation / book of django. now i get it.

Re: httpresponse creates file in /tmp

2011-08-16 Thread Landy Chapman
The example here: https://docs.djangoproject.com/en/1.3/howto/outputting-pdf/ does not use a file; it uses the a file-like object: HttpResponse. That is how my code does it. When I get back I will check if my pdf report also creates a file in /tmp -- You received this message because you

How to Layout a Django Application?

2011-08-16 Thread Andre Lopes
Hi, another question from a Django beginner. I have played with views and templates a little bit, but now I want to make a real layout(Header, Side Column and Footer). There are any guides on layouts that I should follow? There are Apps that will help me with that task? Please le me know. Best

Re: Django-Registration, How can a beginner work with this 3rd party App?

2011-08-16 Thread Andre Lopes
Thanks for your reply. I will follow this tutorial. Best Regards, On Tue, Aug 16, 2011 at 4:36 PM, shacker wrote: > See also: > > django-profiles: The Missing Manual > http://birdhouse.org/blog/2009/06/27/django-profiles/ > > (django-profiles and django-registration are

Re: Json serialization help

2011-08-16 Thread Nate
Thank you for the suggestion. I actually ended up extending Django's json serializer. Here is the code in case you or someone else needs to do something like this. from django.core.serializers.json import Serializer as JsonSerializer from django.utils.encoding import is_protected_type class

M2M with self throught int. table, how to access related items?

2011-08-16 Thread Yaşar Arabacı
Hi, I have tried to sent this e-mail before, but I guess it didn't make its way to the groups so I am trying to resent it, if this is a double post, I am sorry. I am having trouble understanding m2m relation to self with a intermediary table. Here is my table setup stripped: class

Re: For loop problem in template..Is this correct

2011-08-16 Thread victorkendy
Hi The for tag iterates over the elements of the list you are using so your code should be $(function() { var data = []; var i = something(); {% for x in content %} data[i] = { roll_no: {{x.roll_no}},

Re: search with a optional value

2011-08-16 Thread Nan
Filters can be applied in multiple statements, and querysets are evaluated lazily, so the following would work and would only run a single query, when you finally output or otherwise check the contents of the results variable: def get_results(...): ... results =

Re: M2M with self throught int. table, how to access related items?

2011-08-16 Thread Nan
> For example, given a post, how to get set of posts which have traffic from > the post (post.tfrom_set ? ) Have you tried: class Post(models.Model): ... def posts_with_traffic_from_here(self): return Post.objects.filter(tto__tfrom=self) > how to get post with a max "count" which is

Re: Json serialization help

2011-08-16 Thread Andre Terra
Thank you a lot for this snippet! I've wondered about how to export objects to excel in a "more natural way" and this seems to be a great approach, considering all the different gotchas. Thank you for taking the time to write this.. I've been postponing this little bit of research for the

Re: How to Layout a Django Application?

2011-08-16 Thread Andre Terra
There are no particular layouts, but sometimes writing an inclusion tag[1] can help with abstracting some of the logic from the template (especially in the case of side columns that can vary based on context). What I usually do: Write a base.html file with some "default" data, including dummy

Re: Limiting choices for inline manytomany field

2011-08-16 Thread DelS
= > Numerous clever workarounds are given in the forums but I decided to > try using "formfield_for_manytomany" in the inline class. This works > brilliantly. == Make that "...using formfield_for_foreignkey() in the inline class." !!! (Rushing to go for a coffee!) On Aug

Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-16 Thread Mike Seidle
On Wednesday, August 10, 2011 07:03:51 pm Brian Bouterse wrote: > I know it's not Django specific, but when I need a table for my Django > projects, I use jQuery Datatable . It rocks! I highly recommend Datatable... It's not to hard to do either. -- You received

Re: model save question

2011-08-16 Thread Mike Dewhirst
Yaşar Thanks .. the "using" kw hadn't occurred to me but I don't know of any others. I'm happy now. I figure the force_* kwargs were probably the only ones then and it wasn't too difficult for example code to mention them. I prefer the *args, **kwargs version anyway. It hides the gory detail