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
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(
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
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
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
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
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:
>
>
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
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
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
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
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
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.
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,
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
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
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
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
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
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
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
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
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
> 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
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
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
--
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
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
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
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
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
. 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
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
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
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
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
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
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
, 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
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
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
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
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
>
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
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
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,
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
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
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,
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
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,
>
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
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
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
>
> 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
>
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
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
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
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
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.
60 matches
Mail list logo