Re: Extending templates

2012-09-17 Thread Satinderpal Singh
On Tue, Sep 18, 2012 at 9:45 AM, jondykeman  wrote:
> So the header for loop is the one that is not working?
Yes, you are right.

> Is organisation being fed to the view properly?
Yes, it fed properly, as i checked it by making a template for the
organisation view, it correctly fetch values from the database, the
problem is only in extending the for loop to the other file.

> If you put in {{ organisation }} in the section that is rendering properly
> is it showing up as you expect?
Yes, it shows proper results as expected.
>
> JD
>
> On Monday, September 17, 2012 10:59:16 AM UTC-6, Satinder Goraya wrote:
>>
>> On Mon, Sep 17, 2012 at 7:31 PM, jondykeman  wrote:
>> > Can you put the code of the template you are extending this one with?
>> Here is the file that is extending:
>>
>> {% extends "report/report_header.html" %}
>> {% load i18n %}
>> 
>> 
>> {% block content %}
>> 
>> 
>> 
>> Date of testing :> align="left">{{Date_of_testing}}
>> 
>> 
>> Type of Structure:> align="left">{{Type_of_str}}
>> 
>> 
>> Site location:> align="left">Latitude: {{Latitude_N}}Longitude: {{Longitude_E}}
>> 
>> 
>>  
>> Tested in Presence of:> align="left">{{Presence_1}}, {{Presence_2}}
>> 
>> 
>> Report Submitted to > align="left">{{Submitted_1}}, {{Submitted_2}},
>> {{Submitted_3}}
>> 
>>
>> 
>> 
>> 
>> 
>> {% endblock %}
>>
>> You can see full file at:
>> http://202.164.53.122/~satinderpal/report_ok.html
>>
>> > What I would guess from what you said is that you might be using {%
>> > block
>> > head %} {% endblock %} in the other template that extends this one.
>> No, i used {% block content %} {% end block %} for that
>>
>> > In that case you would override that for loop. If you want to add to the
>> > head and also retain that for loop you will need to move the for outside
>> > of
>> > the block in the base template, but will be able to tell better once
>> > seeing
>> Here is the base file :
>> http://202.164.53.122/~satinderpal/report_header.html
>> > the other template's code.
>> http://202.164.53.122/~satinderpal/report_ok.html
>> >
>> > JD
>> >
>> > On Monday, September 17, 2012 1:15:25 AM UTC-6, Satinder Goraya wrote:
>> >>
>> >> I want to extend a template file into the other file. I get fine
>> >> results when done simply but whenever I use the template containing
>> >> 'for' tag into the other, it does not show any results.
>> >> My code for template which is to be extended is here :
>> >>
>> >> #template file to be extended into the other
>> >> 
>> >> 
>> >> {% block header %}
>> >>
>> >> {% for organisations in organisation %}
>> >> > >> >{{organisations.name}}
>> >> {{organisations.address}}
>> >> {% endfor %}
>> >>
>> >>
>> >> {% endblock %}
>> >> 
>> >> {% block content %}{% endblock %}
>> >>
>> >> Please see where I am going wrong.
>> >>
>> >> --
>> >> Satinderpal Singh
>> >> http://satindergoraya.blogspot.in/
>> >> http://satindergoraya91.blogspot.in/
>> >
>> > --
>> > 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/-/wTGigHz33vYJ.
>> > To post to this group, send email to django...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>> --
>> Satinderpal Singh
>> http://satindergoraya.blogspot.in/
>> http://satindergoraya91.blogspot.in/
>
> --
> 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/-/gF9AcKpbRWsJ.
>
> 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.



-- 
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/

-- 
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: tree.io installation with django

2012-09-17 Thread Fabian Weiss
Just I cannot login! :-D
admin/admin doesn't work.. :/
Does it has something to do with settings.py?

ADMINS = (
# ('Your Name', 'your_em...@domain.com'),
)
 
Should I done this before I start installation??

-- 
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/-/nlLMs0j3dFoJ.
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: tree.io installation with django

2012-09-17 Thread Fabian Weiss
WOHO! THX Guys! :)
This worked! Why is the INSTALL of the tarball other than the instruction 
on git???
So now it works and I am happy! :)

Am Montag, 17. September 2012 15:22:41 UTC+2 schrieb Nick Apostolakis:
>
> On 16/09/2012 11:53 οΏ½οΏ½, Fabian Weiss wrote: 
> > Allright, I didnt know that! So here are the requirments! I deinstalled 
> > django debian packet and used pip. Works very well! But some of the 
> > requiered software is also available and installed on my system through 
> > APT! For example python-dateutil. What to do? Deinstall it and install 
> it 
> > with pip?? 
> > 
> > I did like this "pip install -U Django==1.3" for the hole list: 
> > 
> > Django==1.3 
> > Pygments==1.3.1 
> > south 
> > jinja2==2.5.2 
> > coffin 
> > hashlib 
> > PIL 
> > html5lib==0.90 
> > oauth2 
> > whoosh 
> > python-dateutil 
> > django-dajax 
> > django-dajaxice 
> > django-piston==0.2.2 
> > django-simple-captcha 
> > unidecode 
> > django-websocket 
> > docutils 
> > simplejson 
> > sphinx 
> > johnny-cache 
> > django-pandora 
> > 
> > Than I startet again from scratch. I created the treeio dir and went 
> into 
> > this. I started the configure as root, works well. Then the patch, and 
> this 
> > time it made trouble! 
> > http://snipurl.com/250l4g8 
> > Datei oder Verzeichnis nicht gefunden = File or directory not found. 
> > 
> > As usual I just continued with "python manage.py installdb" and "python 
> > manage.py loaddata data.json" and as usual I got the same error: 
> > "django.core.exceptions.ImproperlyConfigured: You're using the 
> staticfiles 
> > app without having set the STATIC_ROOT setting." 
> > 
> > Sorry, but: I STILL DONT KNOW WHERE TO ENTER MY MYSQL INFORMATION!??? 
> > 
> > But, this time I can see something!!! :) http://project.immersight.de/ 
> > But what I now wrong?? 
> > 
> > 
> > 
> when you use virtualenv your system configuration is bypassed altogether. 
> I have installed tree.io three days ago (after seeing your first email 
> to the list) using the source code and the instructions at github 
>
> https://github.com/treeio/treeio 
>
>
> I should say that you need to follow the instructions closely otherwise 
> you will get errors. 
>
> -- 
>   -- 
> Nick Apostolakis 
>e-mail: nick...@oncrete.gr  
>   Web Site: http://nick.oncrete.gr 
>   -- 
>
>
>

-- 
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/-/KNYMEroWg00J.
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: Extending templates

2012-09-17 Thread jondykeman
So the header for loop is the one that is not working?

Is organisation being fed to the view properly?

If you put in {{ organisation }} in the section that is rendering properly 
is it showing up as you expect?

JD

On Monday, September 17, 2012 10:59:16 AM UTC-6, Satinder Goraya wrote:
>
> On Mon, Sep 17, 2012 at 7:31 PM, jondykeman  
> wrote: 
> > Can you put the code of the template you are extending this one with? 
> Here is the file that is extending: 
>
> {% extends "report/report_header.html" %} 
> {% load i18n %} 
>  
>  
> {% block content %} 
>  
>  
>  
> Date of testing : align="left">{{Date_of_testing}} 
>  
>  
> Type of Structure: align="left">{{Type_of_str}} 
>  
>  
> Site location: align="left">Latitude: {{Latitude_N}}Longitude: {{Longitude_E}} 
>  
>  
>   
> Tested in Presence of: align="left">{{Presence_1}}, {{Presence_2}} 
>  
>  
> Report Submitted to  align="left">{{Submitted_1}}, {{Submitted_2}}, 
> {{Submitted_3}} 
>  
>   
>  
>  
>  
>  
> {% endblock %} 
>
> You can see full file at: 
> http://202.164.53.122/~satinderpal/report_ok.html 
>
> > What I would guess from what you said is that you might be using {% 
> block 
> > head %} {% endblock %} in the other template that extends this one. 
> No, i used {% block content %} {% end block %} for that 
>
> > In that case you would override that for loop. If you want to add to the 
> > head and also retain that for loop you will need to move the for outside 
> of 
> > the block in the base template, but will be able to tell better once 
> seeing 
> Here is the base file : 
> http://202.164.53.122/~satinderpal/report_header.html 
> > the other template's code. 
> http://202.164.53.122/~satinderpal/report_ok.html 
> > 
> > JD 
> > 
> > On Monday, September 17, 2012 1:15:25 AM UTC-6, Satinder Goraya wrote: 
> >> 
> >> I want to extend a template file into the other file. I get fine 
> >> results when done simply but whenever I use the template containing 
> >> 'for' tag into the other, it does not show any results. 
> >> My code for template which is to be extended is here : 
> >> 
> >> #template file to be extended into the other 
> >>  
> >>  
> >> {% block header %} 
> >> 
> >> {% for organisations in organisation %} 
> >>  >> >{{organisations.name}} 
> >> {{organisations.address}} 
> >> {% endfor %} 
> >> 
> >> 
> >> {% endblock %} 
> >>  
> >> {% block content %}{% endblock %} 
> >> 
> >> Please see where I am going wrong. 
> >> 
> >> -- 
> >> Satinderpal Singh 
> >> http://satindergoraya.blogspot.in/ 
> >> http://satindergoraya91.blogspot.in/ 
> > 
> > -- 
> > 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/-/wTGigHz33vYJ. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
>
>
>
> -- 
> Satinderpal Singh 
> http://satindergoraya.blogspot.in/ 
> http://satindergoraya91.blogspot.in/ 
>

-- 
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/-/gF9AcKpbRWsJ.
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: 502 Proxy Error trying to export PDF

2012-09-17 Thread Tien Phan
Hi 

I had a similar problem, Django returned a json string well (but it takes 
longer than normal to generate) but Apache proxy still fail with 502 error. 
I raised up timeout limit in apache setting already.
Still looking for an explanation and a solution 
Thanks and regards

On Monday, August 2, 2010 7:00:12 PM UTC+7, marcoshernandez wrote:
>
> this is my error log: 
> [Mon Aug 02 04:46:10 2010] [error] [client 190.205.171.66] proxy: 
> error reading status line from remote server 10.4.139.31, referer: 
> http://foo.bar.com/reportes/guias/?operaciones=12=20= 
> [Mon Aug 02 04:46:10 2010] [error] [client 190.205.171.66] proxy: 
> Error reading from remote server returned by /reportes/guias/, 
> referer: http://foo.bar.com/reportes/guias/?operaciones=12=20= 
>
> And the error says textually: 
> Proxy Error 
>
> The proxy server received an invalid response from an upstream server. 
> The proxy server could not handle the request GET /reportes/guias/. 
>
> Reason: Error reading from remote server 
>
> Apache/2.0.54 Server at argos.globalserviciosrh.com Port 80 
>
>
> On Aug 2, 6:47 am, marcoshernandez  wrote: 
> > Hi. 
> > I'm using pisa (XHTML2PDF) for export the view results in a pdf 
> > The view is generated, a template is filled, then is passed to pisa 
> > and returned as a filestream. Later it's delivered via HTTP. It works 
> > fine for the most of the cases but I have a particular query that 
> > won't go out this way and throw a 502 error. I haven't figured out yet 
> > what's going on because I cannot backtrace the error. Any idea on hoy 
> > to get this working? at least where to look!

-- 
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/-/nxOkwDnEK_MJ.
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.



Announcing django user group switzerland

2012-09-17 Thread Stefan Foulis
*Dear Djangonauts

After the positive experiences at djangocon 2012 in Zürich, we’d like to 
further strengthen the swiss django user community and therefore invite you 
to the first meetup of the django user group switzerland. We plan to have 
bi-monthly meetings at alternating locations.

The first meetup will take place on the 25th of October 2012 at 19:00 at 
the Divio offices in Zürich. There will be food and drinks.

Please RSVP at 
http://www.meetup.com/Django-User-Group-Switzerland/events/82358442/

We’re looking for speakers, so if you’d like to present a talk, please 
contact us over our meetup.com page (
http://www.meetup.com/Django-User-Group-Switzerland/).

Cheers*
*
Stefan Foulis*

-- 
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/-/LV4SMNZ4qWQJ.
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 can I filter the result by datediff in the admin site,and then save into excel

2012-09-17 Thread CrazyNPC
I'm a fresh man.I need help.
Now,I need filter the result by datediff in the admin site,and then write 
them into excel.
Thanks.

-- 
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/-/BmG2HimNym0J.
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: Django & postgresql arrayfield support + filtering objects based on array contents

2012-09-17 Thread Gustavo Díaz Jaimes
Hello

u'r looking for "extra" Query method.
https://docs.djangoproject.com/en/dev/ref/models/querysets/#extra

An other option more sofisticated but still work in progress, is use the 
postgres manager in the project django-orm-extension
in order to use the expressions functions.
http://django-orm.readthedocs.org/en/latest/orm-expressions.html

On Monday, September 3, 2012 7:15:11 AM UTC-5, zayatzz wrote:
>
> Hello
>
> About a year ago i found this :
>
> https://github.com/aino/django-arrayfields
>
> and developed upon it (https://github.com/zay2/django-arrayfields) and 
> integrated it into my project. Now i know that in postgresql i can do 
> something like this:
>
> SELECT * FROM sal_emp WHERE 1 = ANY (pay_by_quarter);
>
> where pay_by_quarter is arrayfield, to select rows by value in arrayfield. 
> But since django does not offer postgresql arrayfields support im quite 
> sure it does not support filtering based on arrayfield contents. 
>
> But still i would like to be able to do just that in my project - so what 
> should i extend now? Queryset filter method or rather query_utils.Q class? 
> Or should i even bother since this arrayfield can be looked up as string 
> and its contents can be searched like 
> queryset.filter(fieldname_icontains='something') or should i rather use raw 
> query there?
>
> what do you think?
>
> Alan
>

-- 
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/-/zeVdxyD3xwcJ.
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: Customizing the Django Admin Interface

2012-09-17 Thread hevok
Well, yes. The magic pony is doing everything for you, if you just treat it 
correctly!

Basically, put the modified admin templates and static files exactly there 
were you are serving your own templates and static assets normally in you 
project directory.
For instance, treat the admin as an app and place the customized templates 
into `templates/admin/`. Django will first look in your own directory and 
use the files there.

These two videos might be of interest regarding this topic:
1. http://pyvideo.org/video/576/customizing-the-django-admin
2. http://pyvideo.org/video/56/djangocon-2010--customizing-the-django-admin

There is also 
django-grappelliwhich 
illustrates how to customize the admin in an excellent way.

Regards,
Hevok


On Monday, September 17, 2012 10:57:30 PM UTC+2, JJ Zolper wrote:
>
> Hevok so what are the steps for doing this?
>
> Sure I know where the admin files are located but once I have copied them 
> does magic just happen and Django uses my new configurations?
>
> Thanks,
>
> JJ
>
> PS. apparently after I left my website alone for a little the CSS 
> propagated through and now I see this:
>
> http://www.madtrak.com/admin 
>
> Which has the red, different text color, etc.
>
> On Sunday, September 16, 2012 4:34:10 AM UTC-4, hevok wrote:
>>
>> Its the correct way to copy the templates and static files into your
>> project folder, if you want to customize them. Otherwise the changes
>> would disappear as soon as you deploy or setup-up your project on a
>> different computer/virtual environment.
>>
>> Try F5, CTRL-F5 or CTRL-R to reload CSS in the browser as they are often
>> kept in cache.
>>
>> Best regards,
>> Hevok
>>
>>
>> On Sunday, September 16, 2012 8:25:18 AM UTC+2, JJ Zolper wrote:
>>>
>>> Hello,
>>>
>>> I was able to locate the Django files for the admin under contrib in the 
>>> source. I was curious if I could get some tips about customizing the 
>>> interface.
>>>
>>> One website I read said I shouldn't change any of the Django source but 
>>> if I want to set up a slightly different login page for example, to put the 
>>> admin files in my local directories that I'm working with.
>>>
>>> The real question is that I was able to edit some template files to 
>>> change some of the wording displayed but when I tried to edit the CSS files 
>>> to get a different design I did not see any changes when I restarted my 
>>> server. Is there some sort of collectstatic command that needs to be run? 
>>> Any input on how to propagate these CSS files through would be great.
>>>
>>> Thanks,
>>>
>>> JJ Zolper
>>>
>>

-- 
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/-/iUWmJ2Zo7PIJ.
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: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Nikolas Stevenson-Molnar
To go a bit further: never use TextEdit to edit source code of any kind,
even in plain text mode. It's simply not designed for that. TextWrangler
makes a great source editor and has some very handy features. However,
for full-blown projects with many source files, etc. you may find it
easier to use an IDE. Aptana is free and decent: http://www.aptana.com/.
PyCharm costs money, but is amazing for Python projects; the debugger
along is worth the price of admission, IMO:
http://www.jetbrains.com/pycharm/

_Nik

On 9/17/2012 3:11 PM, Nikolas Stevenson-Molnar wrote:
> Text Wranger is a plain-text only editor, whereas TextEdit is a rich
> text editor by default (you can toggle plain text). This means that
> when you type HTML characters in to TextEdit, such as
> *Blah*, you're not getting true *<>* characters, but
> something like ** (<) and ** (>). So your template probably
> actually had something like *strongBlah/strong* which
> is, of course, not an HTML tag. TextWrangler, on the other hand,
> doesn't do rich text at all, so what you see is what gets saved to the
> file.
>
> _Nik
>
> On 9/17/2012 1:45 PM, Helly wrote:
>> I am SO SORRY, and in the future I promise to wait at least a week
>> before posting my problems to see if I can figure it out in the
>> meantime. I fixed this by saving the file in TextWrangler instead of
>> TextEdit, and now it interprets the HTML properly. If anyone knows
>> /why/ this fixes the problem, I would still appreciate your insight,
>> but it appears that I have fixed the main issue for now.
>>
>> On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>>
>> I'm currently going through the Django tutorial, and everything
>> was going perfectly smoothly until the template part. This is
>> what I always get for the polls/index.html:
>>
>> http://pastebin.com/ng9iGNRp
>>
>> I noticed that it gets everything right (the {{ poll.id
>>  }} is 1, there's no other error) but just
>> doesn't seem to "understand" html.
>>
>> The only answer I found related to this problem mentioned
>> autoescaping.
>>
>> So I added the {% autoescape off %} {% endautoescape %} tags to
>> the index.html template (this is my polls/index.html, btw):
>>  
>> http://pastebin.com/tzzamJSf
>>
>> But, it didn't fix the problem. I have tried this template
>> without those tags, with autoescape on, and with the tags in
>> various different positions. Changing the tags around moves the
>> text around a little bit, does nothing, or produces a syntax
>> error. I also tried it with the render_to_response() shortcut,
>> and it still displayed the same, raw HTML.
>>
>> When I Google this, other answers mostly regard what to do if you
>> do want the raw html to show up. Also, it doesn't really make
>> sense for the default to be leaving my HTML hanging out for
>> everyone to see.
>>
>> This is my views.py: http://pastebin.com/74t5PMgj
>> 
>>
>> urls.py: http://pastebin.com/BSRXUWpH 
>>
>> I didn't experiment at all. They are exactly what is written in
>> the tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python
>> 2.7.1. I am just doing the tutorial on my localhost
>> (127.0.0.1:8000 ). What is going on?
>> Normally, I can load HTML to my browser just fine. I'm very new
>> to this so I could absolutely be missing something totally
>> obvious. Any help would be greatly appreciated! In the meantime,
>> I will keep trying at this.
>>
>> -- 
>> 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/-/pPpt3enw-bwJ.
>> 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.
>

-- 
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: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Nikolas Stevenson-Molnar
Text Wranger is a plain-text only editor, whereas TextEdit is a rich
text editor by default (you can toggle plain text). This means that when
you type HTML characters in to TextEdit, such as
*Blah*, you're not getting true *<>* characters, but
something like ** (<) and ** (>). So your template probably
actually had something like *strongBlah/strong* which
is, of course, not an HTML tag. TextWrangler, on the other hand, doesn't
do rich text at all, so what you see is what gets saved to the file.

_Nik

On 9/17/2012 1:45 PM, Helly wrote:
> I am SO SORRY, and in the future I promise to wait at least a week
> before posting my problems to see if I can figure it out in the
> meantime. I fixed this by saving the file in TextWrangler instead of
> TextEdit, and now it interprets the HTML properly. If anyone knows
> /why/ this fixes the problem, I would still appreciate your insight,
> but it appears that I have fixed the main issue for now.
>
> On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>
> I'm currently going through the Django tutorial, and everything
> was going perfectly smoothly until the template part. This is what
> I always get for the polls/index.html:
>
> http://pastebin.com/ng9iGNRp
>
> I noticed that it gets everything right (the {{ poll.id
>  }} is 1, there's no other error) but just doesn't
> seem to "understand" html.
>
> The only answer I found related to this problem mentioned
> autoescaping.
>
> So I added the {% autoescape off %} {% endautoescape %} tags to
> the index.html template (this is my polls/index.html, btw):
>  
> http://pastebin.com/tzzamJSf
>
> But, it didn't fix the problem. I have tried this template without
> those tags, with autoescape on, and with the tags in various
> different positions. Changing the tags around moves the text
> around a little bit, does nothing, or produces a syntax error. I
> also tried it with the render_to_response() shortcut, and it still
> displayed the same, raw HTML.
>
> When I Google this, other answers mostly regard what to do if you
> do want the raw html to show up. Also, it doesn't really make
> sense for the default to be leaving my HTML hanging out for
> everyone to see.
>
> This is my views.py: http://pastebin.com/74t5PMgj
> 
>
> urls.py: http://pastebin.com/BSRXUWpH 
>
> I didn't experiment at all. They are exactly what is written in
> the tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python 2.7.1.
> I am just doing the tutorial on my localhost (127.0.0.1:8000
> ). What is going on? Normally, I can load
> HTML to my browser just fine. I'm very new to this so I could
> absolutely be missing something totally obvious. Any help would be
> greatly appreciated! In the meantime, I will keep trying at this.
>
> -- 
> 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/-/pPpt3enw-bwJ.
> 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.

-- 
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: Customizing the Django Admin Interface

2012-09-17 Thread JJ Zolper
Derek,

You can see the custom changes I made here:

http://www.madtrak.com/admin 

That is the extent of what I have done in relation to the default. Nothing 
more then some colors in the CSS and text color. Additionally I changed the 
actual wording for the  to  Log in | MadTrak Django 
Admin other then that text change and the colors I'm not sure what 
you are asking?

What is:

I cannot seem to find the source text, for example, for "Select ... to 
change"
and would appreciate seeing/knowing how you did it.

referring to?

JJ

On Monday, September 17, 2012 3:09:26 AM UTC-4, Derek wrote:
>
> Hi JJ
>
> I'd like to know how you changed the wording... I cannot seem to find the 
> source text, for example, for "Select ... to change"
> and would appreciate seeing/knowing how you did it.
>
> There are examples on various blogs, but Django has changed how it is 
> works since they were written.
>
> Thanks
> Derek
>
> On Sunday, 16 September 2012 08:25:18 UTC+2, JJ Zolper wrote:
>>
>> Hello,
>>
>> I was able to locate the Django files for the admin under contrib in the 
>> source. I was curious if I could get some tips about customizing the 
>> interface.
>>
>> One website I read said I shouldn't change any of the Django source but 
>> if I want to set up a slightly different login page for example, to put the 
>> admin files in my local directories that I'm working with.
>>
>> The real question is that I was able to edit some template files to 
>> change some of the wording displayed but when I tried to edit the CSS files 
>> to get a different design I did not see any changes when I restarted my 
>> server. Is there some sort of collectstatic command that needs to be run? 
>> Any input on how to propagate these CSS files through would be great.
>>
>> Thanks,
>>
>> JJ Zolper
>>
>

-- 
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/-/ezvcwLBOUMgJ.
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: Customizing the Django Admin Interface

2012-09-17 Thread JJ Zolper
Pretty sure you're in the wrong thread bud.

On Sunday, September 16, 2012 2:52:34 AM UTC-4, Gutso wrote:
>
> Hi Everyone, 
>
> I have one query:
>
> Should we change the database(mySQL) table's engine through migration 
> scripts or not? If not then why?
>
> Following were my proposal:
>
> def forwards(self, orm):
>  
> # Change engine from MYISAM to INNODB
> db.execute('alter table abc ENGINE=INNODB;')
>
> def backwards(self, orm):
>
># Revert Engine to MYISAM
> db.execute('alter table abc ENGINE=MYISAM;')
>
> - gurpreet
>

-- 
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/-/YbLLdanMN8cJ.
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: Customizing the Django Admin Interface

2012-09-17 Thread JJ Zolper
Hevok so what are the steps for doing this?

Sure I know where the admin files are located but once I have copied them 
does magic just happen and Django uses my new configurations?

Thanks,

JJ

PS. apparently after I left my website alone for a little the CSS 
propagated through and now I see this:

http://www.madtrak.com/admin 

Which has the red, different text color, etc.

On Sunday, September 16, 2012 4:34:10 AM UTC-4, hevok wrote:
>
> Its the correct way to copy the templates and static files into your
> project folder, if you want to customize them. Otherwise the changes
> would disappear as soon as you deploy or setup-up your project on a
> different computer/virtual environment.
>
> Try F5, CTRL-F5 or CTRL-R to reload CSS in the browser as they are often
> kept in cache.
>
> Best regards,
> Hevok
>
>
> On Sunday, September 16, 2012 8:25:18 AM UTC+2, JJ Zolper wrote:
>>
>> Hello,
>>
>> I was able to locate the Django files for the admin under contrib in the 
>> source. I was curious if I could get some tips about customizing the 
>> interface.
>>
>> One website I read said I shouldn't change any of the Django source but 
>> if I want to set up a slightly different login page for example, to put the 
>> admin files in my local directories that I'm working with.
>>
>> The real question is that I was able to edit some template files to 
>> change some of the wording displayed but when I tried to edit the CSS files 
>> to get a different design I did not see any changes when I restarted my 
>> server. Is there some sort of collectstatic command that needs to be run? 
>> Any input on how to propagate these CSS files through would be great.
>>
>> Thanks,
>>
>> JJ Zolper
>>
>

-- 
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/-/8Cop1sBPfqYJ.
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: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Helly
I am SO SORRY, and in the future I promise to wait at least a week before 
posting my problems to see if I can figure it out in the meantime. I fixed 
this by saving the file in TextWrangler instead of TextEdit, and now it 
interprets the HTML properly. If anyone knows *why* this fixes the problem, 
I would still appreciate your insight, but it appears that I have fixed the 
main issue for now.

On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>
> I'm currently going through the Django tutorial, and everything was going 
> perfectly smoothly until the template part. This is what I always get for 
> the polls/index.html:
>
> http://pastebin.com/ng9iGNRp
>
> I noticed that it gets everything right (the {{ poll.id }} is 1, there's 
> no other error) but just doesn't seem to "understand" html.
>
> The only answer I found related to this problem mentioned autoescaping.
>
> So I added the {% autoescape off %} {% endautoescape %} tags to the 
> index.html template (this is my polls/index.html, btw):
>  
> http://pastebin.com/tzzamJSf
>
> But, it didn't fix the problem. I have tried this template without those 
> tags, with autoescape on, and with the tags in various different positions. 
> Changing the tags around moves the text around a little bit, does nothing, 
> or produces a syntax error. I also tried it with the render_to_response() 
> shortcut, and it still displayed the same, raw HTML.
>
> When I Google this, other answers mostly regard what to do if you do want 
> the raw html to show up. Also, it doesn't really make sense for the default 
> to be leaving my HTML hanging out for everyone to see.
>
> This is my views.py: http://pastebin.com/74t5PMgj
>
> urls.py: http://pastebin.com/BSRXUWpH
>
> I didn't experiment at all. They are exactly what is written in the 
> tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python 2.7.1. I am just 
> doing the tutorial on my localhost (127.0.0.1:8000). What is going on? 
> Normally, I can load HTML to my browser just fine. I'm very new to this so 
> I could absolutely be missing something totally obvious. Any help would be 
> greatly appreciated! In the meantime, I will keep trying at this.
>

-- 
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/-/pPpt3enw-bwJ.
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: post method problem in django template

2012-09-17 Thread Navnath Gadakh


On Monday, September 17, 2012 10:36:55 PM UTC+5:30, Navnath Gadakh wrote:
>
> i have used one HTML select box in my template having name of product as 
> two string but when i send this value by post method in view it takes only 
> one string?plz help 
>



how to submit form using jquery? and how to display response from view? 

-- 
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/-/WSpO7PvFhpcJ.
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.



Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Helly
I'm currently going through the Django tutorial, and everything was going 
perfectly smoothly until the template part. This is what I always get for 
the polls/index.html:

http://pastebin.com/ng9iGNRp

I noticed that it gets everything right (the {{ poll.id }} is 1, there's no 
other error) but just doesn't seem to "understand" html.

The only answer I found related to this problem mentioned autoescaping.

So I added the {% autoescape off %} {% endautoescape %} tags to the 
index.html template (this is my polls/index.html, btw):
 
http://pastebin.com/tzzamJSf

But, it didn't fix the problem. I have tried this template without those 
tags, with autoescape on, and with the tags in various different positions. 
Changing the tags around moves the text around a little bit, does nothing, 
or produces a syntax error. I also tried it with the render_to_response() 
shortcut, and it still displayed the same, raw HTML.

When I Google this, other answers mostly regard what to do if you do want 
the raw html to show up. Also, it doesn't really make sense for the default 
to be leaving my HTML hanging out for everyone to see.

This is my views.py: http://pastebin.com/74t5PMgj

urls.py: http://pastebin.com/BSRXUWpH

I didn't experiment at all. They are exactly what is written in the 
tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python 2.7.1. I am just 
doing the tutorial on my localhost (127.0.0.1:8000). What is going on? 
Normally, I can load HTML to my browser just fine. I'm very new to this so 
I could absolutely be missing something totally obvious. Any help would be 
greatly appreciated! In the meantime, I will keep trying at this.

-- 
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/-/nMbN_S0NvocJ.
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.



ANN: template previewer app (for developers)

2012-09-17 Thread Daniel Moisset
Hi,
   I wanted to share a developer-oriented app I've started working on.

Short version: https://github.com/machinalis/django-template-previewer/(includes
description and screenshots)

Slightly longer version: This app allows a developer to render django
templates by just entering the template name and context data form a UI. So
you can design templates and preview what they'll look like without having
to write the code for a view or generating "real" data. At this moment is a
minimally working proof-of-concept, but it's usable enough to decouple a
bit the design work with the coding work.

There are a lot of rough edges to improve (there's an issue tracker on
github), but I'd love to have ffedback for you

Regards,
Daniel

--
Machinalis - the missing piece - http://machinalis.com/

-- 
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.



image problem

2012-09-17 Thread Harjot Mann
anyone  tel me how to display images on html links using django..
what path should be given in settings.py file

-- 
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/-/BqnSFJG4qSkJ.
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.



post method problem in django template

2012-09-17 Thread Navnath Gadakh
i have used one HTML select box in my template having name of product as 
two string but when i send this value by post method in view it takes only 
one string?plz help 

-- 
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/-/pOz6ti1ZWOYJ.
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: Extending templates

2012-09-17 Thread Satinderpal Singh
On Mon, Sep 17, 2012 at 7:31 PM, jondykeman  wrote:
> Can you put the code of the template you are extending this one with?
Here is the file that is extending:

{% extends "report/report_header.html" %}
{% load i18n %}


{% block content %}



Date of testing :{{Date_of_testing}}


Type of Structure:{{Type_of_str}}


Site location:Latitude: {{Latitude_N}}Longitude: {{Longitude_E}}



Tested in Presence of:{{Presence_1}}, {{Presence_2}}


Report Submitted to {{Submitted_1}}, {{Submitted_2}},
{{Submitted_3}}
   





{% endblock %}

You can see full file at: http://202.164.53.122/~satinderpal/report_ok.html

> What I would guess from what you said is that you might be using {% block
> head %} {% endblock %} in the other template that extends this one.
No, i used {% block content %} {% end block %} for that

> In that case you would override that for loop. If you want to add to the
> head and also retain that for loop you will need to move the for outside of
> the block in the base template, but will be able to tell better once seeing
Here is the base file :
http://202.164.53.122/~satinderpal/report_header.html
> the other template's code.
http://202.164.53.122/~satinderpal/report_ok.html
>
> JD
>
> On Monday, September 17, 2012 1:15:25 AM UTC-6, Satinder Goraya wrote:
>>
>> I want to extend a template file into the other file. I get fine
>> results when done simply but whenever I use the template containing
>> 'for' tag into the other, it does not show any results.
>> My code for template which is to be extended is here :
>>
>> #template file to be extended into the other
>> 
>> 
>> {% block header %}
>>
>> {% for organisations in organisation %}
>> > >{{organisations.name}}
>> {{organisations.address}}
>> {% endfor %}
>>
>>
>> {% endblock %}
>> 
>> {% block content %}{% endblock %}
>>
>> Please see where I am going wrong.
>>
>> --
>> Satinderpal Singh
>> http://satindergoraya.blogspot.in/
>> http://satindergoraya91.blogspot.in/
>
> --
> 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/-/wTGigHz33vYJ.
> 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.



-- 
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/

-- 
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.



ANN: Maymyo Business Application Infrastructre Beta 0.3.3

2012-09-17 Thread simcc
Hi,

I would like to announce the availability of Maymyo 0.3.3 Beta at 
http://sourceforge.net/projects/maymyo/

Maymyo provides basic infrastructural services required by most enterprise 
apps. These are non-public facing apps meant for an enterprise's internal 
use. The following is copy and pasted from the docs :-

These infrastructural services are generic to most enterprise applications 
:-


   - *Supporting enterprises with a multi-Business Unit hierachical 
   
organisation*
   - *Application Security and Access 
Control*
   - *Calendar and business day 
computations*
   - *Auditing of changes to 
Models*
   - *Automatic Filtering of accessible rows by 
Users*
   - *Messaging and 
Alerts*
 with 
   optional email or sms delivery
   - *Generate Reminders with optional escalation (to 
superiors)*
 based 
   on Model state over time
   - *General purpose dynamic formulas, conditions, cursors, filters and 
   choices*
   - *Background Task Queue for tasks and 
reports*
   - *Job definition and scheduling with business day 
semantics*
   - *Automatic Output spooling to printers and archiving of spool 
files*
   - *Automatic periodic archiving and purging of your 
Models*
   - *Designer defined Application Events and its 
delivery*
   - Designer defined Transaction Selection with Business Rule authorisation
   - Workflow engine for your Document approvals
   - Reporting Engines to execute Text or JasperReport reports
   - Option to use JasperServer as a standalone reporting server
   - Charge Computation Engine
   - Billing Module

Maymyo is targeted at experienced django developers who are building 
enterprise apps. Maymyo by itself is NOT a complete application. It is the 
foundation upon which you build your own enterprise app that solves a 
particular business problem. I use both dojo (with dojango) and jquery. 
Django-piston is also used. You will need a JVM if you plan to run the 
reports. If you want to design reports, you will probably want to use 
iReport and ant (to compile them).

Maymyo is beta software and there is still a lot to do and fix. Do not 
expect too much. Maymyo uses JasperReports as its primary reporting tool. 
You can however use your own reporting tool provided you write your own 
Reporting Engine to run it. Writing reports is at the bottom of my todo 
list, so to date only a single report has been written, just to make sure 
that jasperreport works. The docs are also unfinished. Maymyo is a one-man 
project (with lots of borrowed code from my friend yc loh).

There are currently 3 apps in Maymyo, infra, common and billing. You will 
only need infra. The other 2 can be used if you agree with the way we 
designed our common business objects.

I am looking for django developers with similar interests as mine to work 
together to bring django into the enterprise. At the moment, development is 
moving at glacial speed.

Thanks

simcc
 

-- 
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/-/riVRKaf9qHYJ.
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: Button action to delete files from server

2012-09-17 Thread xactive
Many thanks, I'll give that a try.

On Monday, September 17, 2012 1:57:48 PM UTC+1, Sebastian Henschel wrote:
>
> hey xactive... 
>
> a simple solution, without bells & whistles could be this (assuming 
> File.file_obj is defined as a Django FileField): 
>
> On 09/17/2012 01:15 PM, xactive wrote: 
> > I have little experience with Django/Python but have a problem that I 
> > need to solve. 
> > 
> > Currently I have a button action that allows users of a website to 
> > download files from a displayed list. I want to add a button to allow 
> > users to delete the files if required. 
> > 
> > The current download button is set up as follows on the page itself: 
> > Download 
>
> add to your template: 
>
> Delete 
>
> > And as far as I can see there is a file called views.py which contains 
> > code as follows: 
> > @login_required(login_url='/portal/login/', redirect_field_name=None) 
> > def file_view(request, id, template_name='portal/file_view.html'): 
> > try: 
> > f = File.objects.get(pk=id) 
> > except File.DoesNotExist: 
> > raise Http404 
> > if request.user not in f.recipients.all() and request.user != 
> f.owner: 
> > return HttpResponseForbidden() 
>
> if request.GET.has_key('action'): 
>action = request.GET['action'] 
>if action == 'download': 
>  filename = f.file_obj.name.rsplit('/', 1)[1] 
>  response = HttpResponse() 
>  response['Content-Disposition'] = 'attachment; filename=%s' % 
> filename 
>  response['Content-Length']  = '' 
>  response['X-Accel-Redirect']= '/%s' % f.file_obj.name 
>  return response 
>elif action == 'delete': 
>  f.file_obj.delete() 
>  # read https://docs.djangoproject.com/en/dev/ref/models/fields/ 
>
>  return render_to_response('portal/file_deleted.html', {}, 
>context_instance=RequestContext(request)) 
>
>return render_to_response(template_name, { 
>  'file': f 
>}, context_instance=RequestContext(request)) 
>
>
>
> you still have to create the template file 'portal/file_deleted.html'. 
> or you do a redirect to another URL instead... 
>
> > 
> > Can somebody please help me to create an action to delete files? 
> > 
>
>
> hth, 
>   Sebastian 
>
> -- 
> Sebastian Henschel, Python Developer Web 
> txtr GmbH | Rosenthaler Str. 13 | 10119 Berlin | Germany 
>
>

-- 
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/-/nVZ_4aJQVKYJ.
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: Extending templates

2012-09-17 Thread jondykeman
Can you put the code of the template you are extending this one with?

What I would guess from what you said is that you might be using {% block 
head %} {% endblock %} in the other template that extends this one.

In that case you would override that for loop. If you want to add to the 
head and also retain that for loop you will need to move the for outside of 
the block in the base template, but will be able to tell better once seeing 
the other template's code.

JD

On Monday, September 17, 2012 1:15:25 AM UTC-6, Satinder Goraya wrote:
>
> I want to extend a template file into the other file. I get fine 
> results when done simply but whenever I use the template containing 
> 'for' tag into the other, it does not show any results. 
> My code for template which is to be extended is here : 
>
> #template file to be extended into the other 
>  
>  
> {% block header %} 
>
> {% for organisations in organisation %} 
>  >{{organisations.name}} 
> {{organisations.address}} 
> {% endfor %} 
>  
>  
> {% endblock %} 
>  
> {% block content %}{% endblock %} 
>
> Please see where I am going wrong. 
>
> -- 
> Satinderpal Singh 
> http://satindergoraya.blogspot.in/ 
> http://satindergoraya91.blogspot.in/ 
>

-- 
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/-/wTGigHz33vYJ.
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: java script alert from view after sucessfull opreation

2012-09-17 Thread jondykeman
You can feed variables back through HttpResponse() using json serializer.
eg.
from django.utils import simplejson

response = {'Name': Name, 'Email': activeUser.email}
json = simplejson.dumps(response)
return HttpResponse(json, mimetype="text/json")

You should really look into AJAX as suggested earlier.

JD

On Monday, September 17, 2012 1:29:46 AM UTC-6, JirkaV wrote:
>
> > how to use java script alert from view after sucessfull opreation in 
> view 
>
> Simplest way is to set some context variable (a.k.a. "flag") in the 
> view (e.g. "operation_successful = True") and have a piece of JS code 
> in your template that runs only when this flag is set, e.g: 
>
>   {% if operation_successful %} 
>  
>   alert("operation was successful") 
> 
>  {% endif %} 
>
>   There is a lot more ways to do this, at some later point you will 
> probably want to read about AJAX calls. 
>
>   HTH 
>
>  Jirka 
>

-- 
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/-/-mPy0os1zokJ.
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: tree.io installation with django

2012-09-17 Thread Nick Apostolakis

On 16/09/2012 11:53 μμ, Fabian Weiss wrote:

Allright, I didnt know that! So here are the requirments! I deinstalled
django debian packet and used pip. Works very well! But some of the
requiered software is also available and installed on my system through
APT! For example python-dateutil. What to do? Deinstall it and install it
with pip??

I did like this "pip install -U Django==1.3" for the hole list:

Django==1.3
Pygments==1.3.1
south
jinja2==2.5.2
coffin
hashlib
PIL
html5lib==0.90
oauth2
whoosh
python-dateutil
django-dajax
django-dajaxice
django-piston==0.2.2
django-simple-captcha
unidecode
django-websocket
docutils
simplejson
sphinx
johnny-cache
django-pandora

Than I startet again from scratch. I created the treeio dir and went into
this. I started the configure as root, works well. Then the patch, and this
time it made trouble!
http://snipurl.com/250l4g8
Datei oder Verzeichnis nicht gefunden = File or directory not found.

As usual I just continued with "python manage.py installdb" and "python
manage.py loaddata data.json" and as usual I got the same error:
"django.core.exceptions.ImproperlyConfigured: You're using the staticfiles
app without having set the STATIC_ROOT setting."

Sorry, but: I STILL DONT KNOW WHERE TO ENTER MY MYSQL INFORMATION!???

But, this time I can see something!!! :) http://project.immersight.de/
But what I now wrong??


   

when you use virtualenv your system configuration is bypassed altogether.
I have installed tree.io three days ago (after seeing your first email 
to the list) using the source code and the instructions at github


https://github.com/treeio/treeio


I should say that you need to follow the instructions closely otherwise 
you will get errors.


--
 --
   Nick Apostolakis
  e-mail: nicka...@oncrete.gr
 Web Site: http://nick.oncrete.gr
 --


--
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: TemplateResponse and json

2012-09-17 Thread Sebastian Henschel

heya...

On 09/17/2012 01:18 PM, David wrote:


I am aware of the options to set the content_type when using 
TemplateResponse, but is it possible to make the response itself 
return json converted rendered template and not just a rendered template?


maybe this will work for you:

import json
return json.dumps(rendered_template)


cheers,
 Sebastian

--
Sebastian Henschel, Python Developer Web
txtr GmbH | Rosenthaler Str. 13 | 10119 Berlin | Germany

--
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: Button action to delete files from server

2012-09-17 Thread Sebastian Henschel

hey xactive...

a simple solution, without bells & whistles could be this (assuming 
File.file_obj is defined as a Django FileField):


On 09/17/2012 01:15 PM, xactive wrote:
I have little experience with Django/Python but have a problem that I 
need to solve.


Currently I have a button action that allows users of a website to 
download files from a displayed list. I want to add a button to allow 
users to delete the files if required.


The current download button is set up as follows on the page itself:
Download


add to your template:

Delete

And as far as I can see there is a file called views.py which contains 
code as follows:

@login_required(login_url='/portal/login/', redirect_field_name=None)
def file_view(request, id, template_name='portal/file_view.html'):
try:
f = File.objects.get(pk=id)
except File.DoesNotExist:
raise Http404
if request.user not in f.recipients.all() and request.user != f.owner:
return HttpResponseForbidden()


if request.GET.has_key('action'):
  action = request.GET['action']
  if action == 'download':
filename = f.file_obj.name.rsplit('/', 1)[1]
response = HttpResponse()
response['Content-Disposition'] = 'attachment; filename=%s' % filename
response['Content-Length']  = ''
response['X-Accel-Redirect']= '/%s' % f.file_obj.name
return response
  elif action == 'delete':
f.file_obj.delete()
# read https://docs.djangoproject.com/en/dev/ref/models/fields/

return render_to_response('portal/file_deleted.html', {},
  context_instance=RequestContext(request))

  return render_to_response(template_name, {
'file': f
  }, context_instance=RequestContext(request))



you still have to create the template file 'portal/file_deleted.html'. 
or you do a redirect to another URL instead...




Can somebody please help me to create an action to delete files?




hth,
 Sebastian

--
Sebastian Henschel, Python Developer Web
txtr GmbH | Rosenthaler Str. 13 | 10119 Berlin | Germany

--
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: Button action to delete files from server

2012-09-17 Thread Enyert Viñas
Django provides a File class (django.core.files.File) with File.save() and
File.delete methods. You can associate an action to delete and use
File.delete() to do this task.

2012/9/17 xactive 

> I have little experience with Django/Python but have a problem that I need
> to solve.
>
> Currently I have a button action that allows users of a website to
> download files from a displayed list. I want to add a button to allow users
> to delete the files if required.
>
> The current download button is set up as follows on the page itself:
> Download
>
> And as far as I can see there is a file called views.py which contains
> code as follows:
> @login_required(login_url='/portal/login/', redirect_field_name=None)
> def file_view(request, id, template_name='portal/file_view.html'):
> try:
> f = File.objects.get(pk=id)
> except File.DoesNotExist:
> raise Http404
>
> if request.user not in f.recipients.all() and request.user != f.owner:
> return HttpResponseForbidden()
>
> if request.GET.has_key('action') and request.GET['action'] ==
> 'download':
>
> filename = f.file_obj.name.rsplit('/', 1)[1]
>
> response = HttpResponse()
> response['Content-Disposition'] = 'attachment; filename=%s' %
> filename
> response['Content-Length']  = ''
> response['X-Accel-Redirect']= '/%s' % f.file_obj.name
>
> return response
>
> return render_to_response(template_name, {
> 'file': f
> }, context_instance=RequestContext(request))
>
>
> Can somebody please help me to create an action to delete files?
>
> Thanks
>
> --
> 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/-/kckZZ137xigJ.
> 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.
>

-- 
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: java script alert from view after sucessfull opreation

2012-09-17 Thread Navnath Gadakh

>
> but i used function HttpResponse() not  render_to _response(). So  how 
> to carry variable from view to template with httpresponse()

-- 
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/-/9XPFi-TMy4AJ.
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.



TemplateResponse and json

2012-09-17 Thread David
Hello

I am aware of the options to set the content_type when using 
TemplateResponse, but is it possible to make the response itself return 
json converted rendered template and not just a rendered template?

Thank you

-- 
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/-/QI2KQakKmoQJ.
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.



Button action to delete files from server

2012-09-17 Thread xactive
I have little experience with Django/Python but have a problem that I need 
to solve.

Currently I have a button action that allows users of a website to download 
files from a displayed list. I want to add a button to allow users to 
delete the files if required.

The current download button is set up as follows on the page itself:
Download

And as far as I can see there is a file called views.py which contains code 
as follows:
@login_required(login_url='/portal/login/', redirect_field_name=None)
def file_view(request, id, template_name='portal/file_view.html'):
try:
f = File.objects.get(pk=id)
except File.DoesNotExist:
raise Http404

if request.user not in f.recipients.all() and request.user != f.owner:
return HttpResponseForbidden()

if request.GET.has_key('action') and request.GET['action'] == 
'download':

filename = f.file_obj.name.rsplit('/', 1)[1]

response = HttpResponse()
response['Content-Disposition'] = 'attachment; filename=%s' % 
filename
response['Content-Length']  = ''
response['X-Accel-Redirect']= '/%s' % f.file_obj.name

return response

return render_to_response(template_name, {
'file': f
}, context_instance=RequestContext(request))


Can somebody please help me to create an action to delete files?

Thanks

-- 
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/-/kckZZ137xigJ.
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: java script alert from view after sucessfull opreation

2012-09-17 Thread Jirka Vejrazka
> how to use java script alert from view after sucessfull opreation in view

Simplest way is to set some context variable (a.k.a. "flag") in the
view (e.g. "operation_successful = True") and have a piece of JS code
in your template that runs only when this flag is set, e.g:

  {% if operation_successful %}

  alert("operation was successful")
   
 {% endif %}

  There is a lot more ways to do this, at some later point you will
probably want to read about AJAX calls.

  HTH

 Jirka

-- 
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.



Extending templates

2012-09-17 Thread Satinderpal Singh
I want to extend a template file into the other file. I get fine
results when done simply but whenever I use the template containing
'for' tag into the other, it does not show any results.
My code for template which is to be extended is here :

#template file to be extended into the other


{% block header %}

{% for organisations in organisation %}
{{organisations.name}}
{{organisations.address}}
{% endfor %}


{% endblock %}
  
{% block content %}{% endblock %}

Please see where I am going wrong.

-- 
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/

-- 
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: Customizing the Django Admin Interface

2012-09-17 Thread Derek
Hi JJ

I'd like to know how you changed the wording... I cannot seem to find the 
source text, for example, for "Select ... to change"
and would appreciate seeing/knowing how you did it.

There are examples on various blogs, but Django has changed how it is works 
since they were written.

Thanks
Derek

On Sunday, 16 September 2012 08:25:18 UTC+2, JJ Zolper wrote:
>
> Hello,
>
> I was able to locate the Django files for the admin under contrib in the 
> source. I was curious if I could get some tips about customizing the 
> interface.
>
> One website I read said I shouldn't change any of the Django source but if 
> I want to set up a slightly different login page for example, to put the 
> admin files in my local directories that I'm working with.
>
> The real question is that I was able to edit some template files to change 
> some of the wording displayed but when I tried to edit the CSS files to get 
> a different design I did not see any changes when I restarted my server. Is 
> there some sort of collectstatic command that needs to be run? Any input on 
> how to propagate these CSS files through would be great.
>
> Thanks,
>
> JJ Zolper
>

-- 
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/-/YUTxP5G6k40J.
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.



java script alert from view after sucessfull opreation

2012-09-17 Thread Navnath Gadakh
how to use java script alert from view after sucessfull opreation in view 
ifself?

-- 
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/-/v41IbNfmmgYJ.
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: how to use java script alert in view? i use form submit on post method. After sucessfull opreation in view i want alert

2012-09-17 Thread Navnath Gadakh
on sucess and unsucess i want java script alert.

-- 
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/-/JfhG8Aul82YJ.
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.