Re: How to display on Django page based on user's condition?

2019-11-21 Thread James Dunn
In your view you can do: user = request.user Then you can get Employee with: employee = Employee.objects.get(user=user) Then just get the attributes from the models that you need: eg: employee.division On Thu, 21 Nov 2019 at 19:57, Pema Galey wrote: > Hi All, > I am Employee model directly

How to display on Django page based on user's condition?

2019-11-21 Thread Pema Galey
Hi All, I am Employee model directly link with User model and Employee holds User ID and division from Division model. Every employee holds single Division. class Employee(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) division = models.ForeignKey(

Re: How to refresh part of a Django page with AJAX?

2019-08-20 Thread Gil Obradors
HI I subscribe all @Joseph said, and add: For url dispatcher, can you try with very different stamentlist regex? I think you can't have 2 same regex, or if you want, you may treat this route inside classview About AJAX,I can't help no more, I'm newbie with AJAX, I think that is more

Re: How to refresh part of a Django page with AJAX?

2019-08-19 Thread Joseph Bacchilega
Do not use alerts to debug your JS code. Use console.log() and/or debugger while keeping your Chrome/Firefox console (opens with F12) open. In this case, try to see what "data" is set to in the response success callback function. > But then I think it should be set to empty because I don't

How to refresh part of a Django page with AJAX?

2019-08-18 Thread Xiaoyun Huang
I am deploying a website using Django. There is an application called 'forum', supporting a discussion forum on my website. The url of the discussion forum is 'XXX.com/forum/roomY'. I want to refresh a div id = ''chat'', which includes a message list, on this page when users click a refresh

Re: django Page

2014-07-26 Thread ngangsia akumbo
6/‎07/‎2014 05:18 > To: django...@googlegroups.com > Subject: Re: django Page > > can i intergrate the cms in my site? > cos i will want something dynamic. > > On Friday, July 25, 2014 7:41:26 PM UTC+1, Mulianto wrote: >> >> Hi, >> >> You can use

Re: django Page

2014-07-26 Thread ngangsia akumbo
Thanks for the kind response bro On Saturday, July 26, 2014 7:51:04 PM UTC+1, Mulianto wrote: > > Yes you can, just use it first then you will understand what you can do > with flatpage. > > > > Sent from my iPhone > > On 26 Jul 2014, at 11:17, ngangsia akumbo > wrote: > >

Re: django Page

2014-07-26 Thread mulianto
Yes you can, just use it first then you will understand what you can do with flatpage. Sent from my iPhone On 26 Jul 2014, at 11:17, ngangsia akumbo wrote: > can i intergrate the cms in my site? > cos i will want something dynamic. > > On Friday, July 25, 2014 7:41:26

RE: django Page

2014-07-26 Thread Lukáš Němec
Hi, Try googling django-pages It is a small cms I created. If you encounter some problems, just ask. Lukas -- From: ngangsia akumbo <ngang...@gmail.com> Sent: ‎26/‎07/‎2014 05:18 To: django-users@googlegroups.com Subject: Re: django Page can i intergrate t

Re: django Page

2014-07-25 Thread ngangsia akumbo
can i intergrate the cms in my site? cos i will want something dynamic. On Friday, July 25, 2014 7:41:26 PM UTC+1, Mulianto wrote: > > Hi, > > You can use django flatpage . > > > > Sent from my Mini Ipad > > On 23 Jul 2014, at 15.43, ngangsia akumbo > wrote: > > I want to

Re: django Page

2014-07-25 Thread Mulianto
Hi, You can use django flatpage . Sent from my Mini Ipad > On 23 Jul 2014, at 15.43, ngangsia akumbo wrote: > > I want to create an app where the user has the ability to create new pages on > their website > > the app should be called pages > > can someone give me

Re: django Page

2014-07-24 Thread aRkadeFR
If it's only static pages, you could look first django.contrib.flatpages to see how to do it. On 23/07/14 00:05, ngangsia akumbo wrote: > I want to create an app where the user has the ability to create new pages > on their website > > the app should be called pages > > can someone give me an

Re: django Page

2014-07-23 Thread ngangsia akumbo
i mean django 1.5.8 On Wednesday, July 23, 2014 12:08:58 PM UTC+1, ngangsia akumbo wrote: > > i wanted to get the idea. so that is the reason why i asked if i could > inlcude the cms on my website as an app. > > I have not tried any but i will so , just wanted to get the idea, or a > guidance.

Re: django Page

2014-07-23 Thread ngangsia akumbo
i wanted to get the idea. so that is the reason why i asked if i could inlcude the cms on my website as an app. I have not tried any but i will so , just wanted to get the idea, or a guidance. I have had alot of probs withurls with django 1.5.13 On Wednesday, July 23, 2014 11:27:06 AM UTC+1,

Re: django Page

2014-07-23 Thread Babatunde Akinyanmi
On 23 Jul 2014 11:08, "ngangsia akumbo" wrote: > > this is what am doing. > I am creating a website which i will like to include the ability of adding pages to that site. > > I have already a news, event and gallery app working, i wish to include the ability to create other

Re: django Page

2014-07-23 Thread ngangsia akumbo
this is what am doing. I am creating a website which i will like to include the ability of adding pages to that site. I have already a news, event and gallery app working, i wish to include the ability to create other pages on the site by the end user. i am using django1.4 On Wednesday, July

Re: django Page

2014-07-23 Thread Santiago Lamora
2014-07-23 10:15 GMT+02:00 ngangsia akumbo : > Thanks , i have built some apps in my site like new, event and gallery, so > i want to include a new app that will help to create pages on the site > would the link above help me do that? > > What are you trying to do exactly? You

Re: django Page

2014-07-23 Thread ngangsia akumbo
Thanks , i have built some apps in my site like new, event and gallery, so i want to include a new app that will help to create pages on the site would the link above help me do that? On Wednesday, July 23, 2014 8:52:19 AM UTC+1, Santiago L wrote: > > 2014-07-23 9:44 GMT+02:00 ngangsia akumbo

Re: django Page

2014-07-23 Thread ngangsia akumbo
Thanks , i have built some apps in my site like new, event and gallery, so i want to include a new app that will help to create pages on the site would the link above help me do that? On Wednesday, July 23, 2014 8:52:19 AM UTC+1, Santiago L wrote: > > 2014-07-23 9:44 GMT+02:00 ngangsia akumbo

Re: django Page

2014-07-23 Thread Santiago Lamora
2014-07-23 9:44 GMT+02:00 ngangsia akumbo : > I want to create an app where the user has the ability to create new pages > on their website > > the app should be called pages > > can someone give me an idea pease? > Seems that you need something like a CMS. Take a look at

django Page

2014-07-23 Thread ngangsia akumbo
I want to create an app where the user has the ability to create new pages on their website the app should be called pages can someone give me an idea pease? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

django Page

2014-07-23 Thread ngangsia akumbo
I want to create an app where the user has the ability to create new pages on their website the app should be called pages can someone give me an idea pease? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Open the Django page raw-id widget within TinyMCE

2011-11-14 Thread Simon Bächler
Hi Django's raw_id widget is very well suited for selecting a page as a foreign key in the admin frontend. Even from a tree view as it is the case for instance in FeinCMS. TinyMCE on the other hand allows for a dropdown list for link targets. Which is not that great if you have a few hundred

Re: Can you drop a Python script into a Django page?

2011-11-12 Thread Steve McConville
> Is it possible to drop a Python script (around 50 lines) into one of your > django pages? Would this be embedding into the template code? You could wrap it in a custom template tag: https://docs.djangoproject.com/en/1.3/howto/custom-template-tags/ -- steve -- You received this message

Re: Can you drop a Python script into a Django page?

2011-11-12 Thread Joey Espinosa
Jimmy, I don't know your specific situation, but this is probably not worth a fee. You already know Django and Python, all you need to do is extend that knowledge with some AJAX. If you run into problems, there's always this group ;) -- Joey "JoeLinux" Espinosa Software Developer

Re: Can you drop a Python script into a Django page?

2011-11-12 Thread jc
Oh, this does help...tremendously. Thanks for taking the time out and explaining. I think that's enough for me to start learning via the docs/experimenting and hopefully get something implemented. If I can't implement this, do you know anyone that could do this for a fee? thanks, jimmy --

Re: Can you drop a Python script into a Django page?

2011-11-12 Thread Joey Espinosa
Jimmy, Not sure what JavaScript library you use (or if you're familiar with JavaScript at all), but this is a very rudimentary example: First, create a View in Django that you can call, and capture the results: import os > from django.http import HttpResponse > ... > def ajax(req): > if

Re: Can you drop a Python script into a Django page?

2011-11-12 Thread jc
Oh, that would *totally* be fine. I have no idea how to do that, do you know of any docs that might show me how to execute this code on the server-side and print out via AJAX? thanks! jimmy -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Can you drop a Python script into a Django page?

2011-11-12 Thread Joey Espinosa
Jimmy, Does it NEED to be embedded into the page? I ask because something like this would be a lot easier if you executed server-side, and simply returned the output to the front-end using AJAX. Would that serve your purpose here, or am I misunderstanding the original question? -- Joey

Can you drop a Python script into a Django page?

2011-11-12 Thread jc
Hi, Is it possible to drop a Python script (around 50 lines) into one of your django pages? Would this be embedding into the template code? I am experimenting with doing this but I haven't had any luck in finding out how. An example of what I am trying to do is to place a script like this

Re: django page loads forever

2011-06-23 Thread Shawn Milochik
On 06/23/2011 05:05 AM, Nikhil Somaru wrote: for a quick fix you could also import pdb pdb.set_trace() that will drop a shell in your "runserver" window and let you explore the value of variables in the context +1 on pdb http://www.doughellmann.com/PyMOTW/pdb/ -- You received this

Re: django page loads forever

2011-06-23 Thread Nikhil Somaru
. wrote: > >> Hello, everyone >> >> I have a django page which loads indefinitely >> >> some of the javascript that is supposed to come up does not appear on >> the screen (while >> the page is still loading), but i checked with firebugs and there a

Re: django page loads forever

2011-06-22 Thread Shawn Milochik
On 06/22/2011 11:26 AM, jay K. wrote: Hello, everyone I have a django page which loads indefinitely some of the javascript that is supposed to come up does not appear on the screen (while the page is still loading), but i checked with firebugs and there are no error messages at all any advice

django page loads forever

2011-06-22 Thread jay K.
Hello, everyone I have a django page which loads indefinitely some of the javascript that is supposed to come up does not appear on the screen (while the page is still loading), but i checked with firebugs and there are no error messages at all any advice would be helpful thanks jay k

Re: django page cms get_absolute_url return an empty strings andURL issues.

2010-10-26 Thread tricks...@googlemail.com
Sorted. The get absolute url had not been set and the ordering of urls was incorrect. -- 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

django page cms get_absolute_url return an empty strings andURL issues.

2010-10-25 Thread tricks...@googlemail.com
I am having issues with get_absolute_url in my django templates when using django page cms. It returns an empty string and does not link to my required page. I have the following Models, URLs templates and views Models class Body(models.Model): ... url = models.SlugField(unique=True, help_text

Re: How does buildout determine paths needed? (for django-page-cms)

2010-06-29 Thread John Griessen
if that involved templates, or just css, images, and js, but I wouldn't be surprised. The pages templates are examples, IIRC, and you make your own to stick in project_root/templates/pages/ . Hmmm the developer of django-page-cms does not use buildout, so I tried a buildout with django-page-cms

Re: How does buildout determine paths needed? (for django-page-cms)

2010-06-29 Thread Bill Freeman
iated. > Meanwhile, every time I run buildout, I'll need to copy an paste that extra > path... > > John > -buildout.cfg > [buildout] > eggs-directory = /home/john/buildout/eggs > extensions = mr.developer > > parts = >    django > > eggs = >    mo

How does buildout determine paths needed? (for django-page-cms)

2010-06-29 Thread John Griessen
, every time I run buildout, I'll need to copy an paste that extra path... John -buildout.cfg [buildout] eggs-directory = /home/john/buildout/eggs extensions = mr.developer parts = django eggs = mock django-notification django-page-cms django-haystack django

Re: Increase django page timeout

2010-04-22 Thread Javier Guerra Giraldez
On Thu, Apr 22, 2010 at 9:26 AM, Florin wrote: > Maybe a solution would be to put more filters so the data won't be > that large and so it would eventually generate the pdf. no, the solution is to put all the heavy work _out_ of the request/response cycle. just add the

Re: Increase django page timeout

2010-04-22 Thread Florin
It's some statistical data collected about the users of my application. (Anyway good joke :) Even with better hardware it's the same. I installed the app on one of company's ubuntu servers but it also gives "Read Timeout" error... Maybe a solution would be to put more filters so the data won't be

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
are you collect the data from the telephone book? :) kidding, the only right way is to render it in the background. i dont't think you can render it faster, only with better hardware. On Apr 22, 4:10 pm, Florin wrote: > It takes about 10 sec to generate the data, but when

Re: Increase django page timeout

2010-04-22 Thread Florin
It takes about 10 sec to generate the data, but when calling pisaDocument with the generated data it hangs and after a while it gives timeout. On Apr 22, 4:59 pm, "ge...@aquarianhouse.com" wrote: > we say the whole thing takes 60 sec., how many sec. does it take to >

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
we say the whole thing takes 60 sec., how many sec. does it take to collect and how many to render? On Apr 22, 3:54 pm, Florin wrote: > The data is collected quickly. I generate a html with pagination to > preview the results. > If I trace the steps, I can see that the

Re: Increase django page timeout

2010-04-22 Thread Florin
The data is collected quickly. I generate a html with pagination to preview the results. If I trace the steps, I can see that the process hangs after the data is collected, at the line that calls the pisa.pisaDocument method to generate the pdf and write the generated bits in a buffer, which

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
The question is: where is the bottleneck, to collect the data or to generate the pdf??? On Apr 22, 2:54 pm, Florin wrote: > Thanks for the tips. > > Is there any alternative to pisa that can process large amount of data > to generate PDF files? > > On Apr 22, 3:14 pm,

Re: Increase django page timeout

2010-04-22 Thread Florin
Thanks for the tips. Is there any alternative to pisa that can process large amount of data to generate PDF files? On Apr 22, 3:14 pm, Javier Guerra Giraldez wrote: > On Thu, Apr 22, 2010 at 6:25 AM, ge...@aquarianhouse.com > > wrote: > > I your

Re: Increase django page timeout

2010-04-22 Thread Javier Guerra Giraldez
On Thu, Apr 22, 2010 at 6:25 AM, ge...@aquarianhouse.com wrote: > I your case i would put this task in queue or kind of a back process. +1 Queues are the way to go. in this case, i guess a "Ghetho Queue" would be enough (just a DB table of 'pending tasks', a cron

Re: Increase django page timeout

2010-04-22 Thread Florin
The desired functionality is for the user to choose a filter and based on the results (Progress.objects.filter(...) to generate a pdf which will be downloaded. With a few hundreds results it works just fine, but when there are thousands of results it gives timeout. Thanks! On Apr 22, 2:25 pm,

Re: Increase django page timeout

2010-04-22 Thread Florin
My app is hosted on apache using mod_python. On Apr 22, 2:30 pm, Tom Evans wrote: > On Thu, Apr 22, 2010 at 12:19 PM, Florin wrote: > > Hi! > > > I use pisa to generate large pdf files, but it gives opage timeout > > when generating. > > It

Re: Increase django page timeout

2010-04-22 Thread Tom Evans
On Thu, Apr 22, 2010 at 12:19 PM, Florin wrote: > Hi! > > I use pisa to generate large pdf files, but it gives opage timeout > when generating. > It waits a long time at the following line: > pdf = pisa.pisaDocument(StringIO(html.encode("UTF-8")), dest=buffer, >

Re: Increase django page timeout

2010-04-22 Thread ge...@aquarianhouse.com
I think that would be a wrong approach. I your case i would put this task in queue or kind of a back process. For sure not on demand. On Apr 22, 1:19 pm, Florin wrote: > Hi! > > I use pisa to generate large pdf files, but it gives opage timeout > when generating. > It

Increase django page timeout

2010-04-22 Thread Florin
Hi! I use pisa to generate large pdf files, but it gives opage timeout when generating. It waits a long time at the following line: pdf = pisa.pisaDocument(StringIO(html.encode("UTF-8")), dest=buffer, link_callback=fetch_resources) As a workaround - is it possible to increase the page timeout to

Re: Outdated data in django page rendering w/ cacheing disabled

2009-01-05 Thread Malinka Rellikwodahs
On Fri, Jan 2, 2009 at 09:56, Rajesh Dhawan wrote: >> >> As far as I can tell there is no reason for this data to be outdated >> on browser refresh, I've tried looking through the documentation and >> other places to find what could be causing this > > You didn't include

Re: Outdated data in django page rendering w/ cacheing disabled

2009-01-02 Thread Rajesh Dhawan
> > I have created a set of functions and classes to connect to the db and > request the data and then display the data rendered as a page, however > what I'm finding is that when the data is being changed from the main > set of applications connecting to and using this db and then i refresh >

Outdated data in django page rendering w/ cacheing disabled

2008-12-31 Thread Malinka
I have a django project which will be taking data from a db that is already being managed and maintained by another set of programs and read it and display it for reporting and for determineing possible problems and then in some cases making changes back into the system through other means (not

Re: Django Page - Db Connections count

2008-07-22 Thread madhav
I am using the DebugFooterMiddleware, but it still doesn't show how many postgresql connections are used to fetch all the components in a page. What i want is the total number of db connections count. How can I get that? Please forgive me for my ignorance. On Jul 22, 12:30 pm, Eric Abrahamsen

Re: Django Page - Db Connections count

2008-07-22 Thread Eric Abrahamsen
You could try the debug middleware: http://www.djangosnippets.org/snippets/766/ or the page stats middleware: http://code.djangoproject.com/wiki/PageStatsMiddleware and this article by Simon Willison is a good general resource: http://simonwillison.net/2008/May/22/debugging/ Yours, Eric On

Django Page - Db Connections count

2008-07-22 Thread madhav
Guys, I need some middleware or utility to check how many postgresql connections are actually used to generate a particular page in django. Can We get that by any chance? I am in the real pinch, Please help me. --~--~-~--~~~---~--~~ You received this message

[ANN] Django Page Templates & Exception Formatter

2005-11-01 Thread Stefan H. Holek
Some news for those of us using Zope3 Page Templates with Django: * DjangoPageTemplates 1.0.2 is available. This is a bugfix release to tackle a problem with TALES path expressions. If you have seen unexpected NameErrors, this release is for you.