Re: simple command line ./manage.py shell puzzle

2022-04-21 Thread Larry Martell
On Thu, Apr 21, 2022 at 1:06 PM cseb...@gmail.com wrote: > > Why does this fail?... > > % echo "import datetime ; [datetime for e in [1, 2]]" > test > > % ./manage.py shell < test > > Traceback (most recent call last): > File "./manage.py", line 8, in > django.core.management.execute_from_c

Re: simple command line ./manage.py shell puzzle

2022-04-21 Thread Larry Martell
On Thu, Apr 21, 2022 at 2:53 PM cseb...@gmail.com wrote: > > The script should quietly exist without error. > > I actually have a longer script that is the real workhorse. > I just made this tiny one to showcase the issue. > > I can past > > import datetime ; [datetime for e in [1, 2]] > > into a

Re: variable inside a template

2022-06-16 Thread Larry Martell
On Thu, Jun 16, 2022 at 4:09 AM luca72.b...@gmail.com wrote: > > Hello i have a list like: > mylist = ['1,png','2.png',3.jpj'] > in the template i do as follow: > {% for o in mylist %} > > {% if "png" in o %} > {{ o }} > > {% else %} > {{o}} >

Lost connection to MySQL server during query

2022-06-17 Thread Larry Martell
I have a standalone python script (i.e. not part of a web app) that makes use of the ORM. I call djago.setup(), make some queries, then call a function that can take 8 hours or more to run. When the function returns I want to make more queries, but they fail with 'Lost connection to MySQL server du

getting unique id

2022-11-23 Thread Larry Martell
I have an app that needs to get a unique ID. Many threads run at the same time that need one. I would like the IDs to be sequential. When I need a unique ID I do this: with transaction.atomic(): max_batch_id = JobStatus.objects.select_for_update(nowait=False).aggregate(Max('batch_id')) jso

Re: getting unique id

2022-11-23 Thread Larry Martell
ed. > On Wed, 23 Nov 2022, 16:57 Larry Martell, wrote: >> >> I have an app that needs to get a unique ID. Many threads run at the >> same time that need one. I would like the IDs to be sequential. When I >> need a unique ID I do this: >>

Re: getting unique id

2022-11-23 Thread Larry Martell
> > On Nov 23, 2022, at 8:56 AM, Larry Martell wrote: > > > > I have an app that needs to get a unique ID. Many threads run at the > > same time that need one. I would like the IDs to be sequential. When I > > need a unique ID I do this: > > > >

Re: AttributeError: module 'django.db.models' has no attribute 'PointField'

2022-11-27 Thread Larry Martell
On Sun, Nov 27, 2022 at 2:40 PM Ilyas Modni wrote: > > AttributeError: module 'django.db.models' has no attribute 'PointField' Are you importing: from django.contrib.gis.db import models -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

Re: getting unique id

2022-11-28 Thread Larry Martell
On Wed, Nov 23, 2022 at 3:11 PM Larry Martell wrote: > > On Wed, Nov 23, 2022 at 3:01 PM Thomas Lockhart > wrote: > > > > Why not use the existing Django AutoField? > > Because I have multiple rows with the same batch_id, and also I would > like the batch_ids to b

filtering queryset in CreateAPIView view

2022-12-28 Thread Larry Martell
I have a CreateAPIView view with this code in the serializer: class AssignWorkItemSerializer(serializers.Serializer, WorkitemSerializerMixin): assigneeIds = serializers.ListSerializer( child=serializers.PrimaryKeyRelatedField( queryset=get_user_model().objects.filter(userr

Re: Server Error 500 Nginx when DEBUG=False

2023-01-29 Thread Larry Martell
On Sun, Jan 29, 2023 at 9:14 AM ALBERT ASHABA AHEEBWA < ashabaaheebwaalb...@gmail.com> wrote: > So I was able to successfully host my first ever Django app on linode. > After the excitement had won off, I started testing the routes, everything > was running fine except for two routes. > > SERVER E

List validator

2023-02-27 Thread Larry Martell
I have this defined in my serializer: case_status = serializers.ListField( child=serializers.CharField( allow_blank=True, max_length=512, allow_null=True, required=False, default="''", ), source='casestatus',

Re: Unable to write to database

2023-05-22 Thread Larry Martell
On Sun, May 21, 2023 at 10:54 AM William Nash (Bill) wrote: > > I'm new to django and I'm trying to learn as I program a small website for my > scuba diving business. I'm running into a error that when I try to add a > diver the database does not update. When I goto > http://localhost:8000/a

Re: Django date time picker

2023-05-29 Thread Larry Martell
On Mon, May 29, 2023 at 1:14 PM Thomas Mutavi wrote: > > Hello, how can i implement a form with several date fields which have date > and time picker in django? You can use the jQuery UI datetimepicker. -- You received this message because you are subscribed to the Google Groups "Django user

Connection reset by peer on file upload if JWT expires

2023-06-02 Thread Larry Martell
We have a django app and it supports a file upload request. The entire upload comprises multiple requests. We are authenticating with JWT and we have logic to handle a 401 and in that case use the refresh token to get a new access token and resend the failed request. However if the token expires be

uwsgi

2023-06-04 Thread Larry Martell
I normally deploy my django apps using nginx and uwsgi. I recently found that the uwsgi mailing list is defunct, and I read this on the uwsgi github page: Note: The project is in maintenance mode (only bugfixes and updates for new languages apis). Do not expect quick answers on github issues. Are

Re: best resources for learning django

2012-03-02 Thread Larry Martell
On Fri, Mar 2, 2012 at 2:00 PM, Jonathan Holloway wrote: > I sympathise with you.  I'm following the 1.3 online docs and hacking a site > together at the moment. > > an up to date book would be awesome !!! > > I found looking at example projects on Github very useful. > > Cheers, > Jon. > > -- > Y

Re: Live search

2012-03-08 Thread Larry Martell
On Wed, Mar 7, 2012 at 5:57 AM, Karen Tracey wrote: > On Mon, Mar 5, 2012 at 11:25 AM, larry.mart...@gmail.com > wrote: >> I'm fairly new to django, still working on my first project. >> >> I have a page with some selection fields and a button. The user clicks >> the button, I run a query, and di

Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy wrote: > Hi > > Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit : > >> From within a template can I find out the URL that caused the template >> to be invoked? > > You usually should have the request object in your template. See > https://

Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy wrote: > > Le 13 mars 2012 à 18:40, Larry Martell a écrit : > >> On Tue, Mar 13, 2012 at 11:26 AM, Xavier Ordoquy >> wrote: >>> Hi >>> >>> Le 13 mars 2012 à 18:11, larry.mart...@gmail.com a écrit

Getting URL from within a template

2012-03-13 Thread Larry Martell
sed. (I'm fairly new to both django and this job, and I just grepped through the entire code base and it wasn't found.) > > Furbee > > On Tue, Mar 13, 2012 at 11:27 AM, Larry Martell > wrote: >> >> On Tue, Mar 13, 2012 at 11:58 AM, Xavier Ordoquy >>

Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
s-with-jquery.html which > should demonstrate how to get these in javascript on the client-side > browser. I was able to get the entire URL with {{ request.get_full_path }} But thanks for the link - looks like it could be very useful in the future. > On Tue, Mar 13, 2012 at 11:57 AM, Larry Marte

Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
is done and cannot manipulate the page, unless you are using AJAX to get > updated details. When the URL that gets updated by jQuery is clicked on, it goes back to Django/Python and the {{ request.get_full_path }} gets updated. > On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell > wrote:

Re: Django making box

2012-03-13 Thread Larry Martell
On Tue, Mar 13, 2012 at 3:34 PM, Sophia wrote: > Thanks for the help, actually it should be run just on my computer not the > client. In this context the client is the browser. > > On Tuesday, March 13, 2012 1:54:00 PM UTC-7, Javier Guerra wrote: >> >> On Tue, Mar 13, 2012 at 3:37 PM, Sophia wr

Re: Getting URL from within a template

2012-03-13 Thread Larry Martell
ackwards through the data (which is a return back to the server), the filter string can get passed back into the template so it can apply the filtering on the new data set > On Tue, Mar 13, 2012 at 2:42 PM, Larry Martell > wrote: >> >> On Tue, Mar 13, 2012 at 3:33 PM, Furbee wrote

Re: Getting URL from within a template

2012-03-14 Thread Larry Martell
v to be applied to the new page of data. > > > On Tue, Mar 13, 2012 at 3:01 PM, Larry Martell > wrote: >> >> On Tue, Mar 13, 2012 at 3:53 PM, Furbee wrote: >> > Gotcha, I was unclear. You can have jQuery modify the URL without >> > actually >

Re: Getting URL from within a template

2012-03-14 Thread Larry Martell
emplate from the view. >>> >>> There's a 'live filtering' function on the page. It's text field with >>> a keyup event handler. Each time the field gets updated the data >>> currently on the screen is filtered, and the URL is updated to includ

usage of url template tag

2012-03-20 Thread Larry Martell
I'm trying to generate a URL that looks something like this: /report/faloom/EventLog/?message=EventSearchString&tool_ids=13&field_1=Tool&field_2=Time&field_3=Module&field_4=Message&submit_preview=Generate+Report I have the values for the arguments (message, tool_ids, etc) available to me. My ur

Re: usage of url template tag

2012-03-21 Thread Larry Martell
On Tue, Mar 20, 2012 at 11:04 PM, Daniel Roseman wrote: > On Tuesday, 20 March 2012 15:27:27 UTC-7, larry@gmail.com wrote: >> >> I'm trying to generate a URL that looks something like this: >> >> >> /report/faloom/EventLog/?message=EventSearchString&tool_ids=13&field_1=Tool&field_2=Time&field_

using forloop.counter to access data

2012-03-21 Thread Larry Martell
This is probably a stupid newbie question I want to access a column of data in a row using forloop.counter, but I cannot get it to work. In my test code, if I display {{ forloop.counter }} I get 2 If I display {{ headers.0.2 }} I get ToolType But if I display {{ headers.0.forloop.counter }}

Re: using forloop.counter to access data

2012-03-21 Thread Larry Martell
On Wed, Mar 21, 2012 at 7:53 AM, James wrote: > > > On Wednesday, March 21, 2012 8:47:23 AM UTC-4, larry@gmail.com wrote: >> >> This is probably a stupid newbie question >> >> I want to access a column of data in a row using forloop.counter, but >> I cannot get it to work. >> >> In my tes

Re: using forloop.counter to access data

2012-03-21 Thread Larry Martell
On Wed, Mar 21, 2012 at 8:32 AM, Tom Evans wrote: > On Wed, Mar 21, 2012 at 12:47 PM, Larry Martell > wrote: >> This is probably a stupid newbie question >> >> I want to access a column of data in a row using forloop.counter, but >> I cannot get it to wor

Re: usage of url template tag

2012-03-21 Thread Larry Martell
On Wed, Mar 21, 2012 at 2:06 PM, Daniel Roseman wrote: > On Wednesday, 21 March 2012 03:01:23 UTC-7, larry@gmail.com wrote: >> >> >> I'm very new to django. The rest of the URL comes from the index >> function in views.py. I wasn't sure if it violated the DRY principle >> to hardcode it. > > >

Re: using forloop.counter to access data

2012-03-21 Thread Larry Martell
On Wed, Mar 21, 2012 at 12:52 PM, James wrote: > > > On Wednesday, March 21, 2012 10:41:08 AM UTC-4, larry@gmail.com wrote: >> >> On Wed, Mar 21, 2012 at 7:53 AM, James <> wrote: >> > >> > >> > On Wednesday, March 21, 2012 8:47:23 AM UTC-4, larry@gmail.com >> > wrote: >> >> >> >> This is p

Adding link to admin page

2012-03-25 Thread Larry Martell
I have a client that has an app built with django. On every page of their app is a link to their admin site. They tell me the admin site is generated entirely by django, and they've never customized it before. On the very first line of the admin page it says: Django administration Welcome

Re: Adding link to admin page

2012-03-26 Thread Larry Martell
On Mon, Mar 26, 2012 at 4:37 PM, Mike Dewhirst wrote: > On 27/03/2012 9:16am, larry.mart...@gmail.com wrote: >> >> On Mar 25, 3:29 pm, Larry Martell  wrote: >>> >>> I have a client that has an app built with django. On every page of >>> their app is a

Re: Adding link to admin page

2012-03-26 Thread Larry Martell
On Mon, Mar 26, 2012 at 7:25 PM, Mike Dewhirst wrote: > On 27/03/2012 10:16am, Larry Martell wrote: >> >> On Mon, Mar 26, 2012 at 4:37 PM, Mike Dewhirst >>  wrote: >>> >>> On 27/03/2012 9:16am, larry.mart...@gmail.com wrote: >>>> >>>>

Re: Adding link to admin page

2012-03-27 Thread Larry Martell
- - - - - - - - - - - - - - - > > ... and you can see where I tested a link inside {% block branding %} and I > can confirm it works. > > Hth I found my problem - I was putting the full path to the dir with my base_site.html in TEMPLATE_DIRS (e.g. SRC_ROOT/templates/admin/). When I

Upgrading django on a mac

2012-04-07 Thread Larry Martell
I'm on a mac, running Mac OS X Version 10.5.8 (Leopard). I was running django -r 13034 that I got from SVN. I am trying to upgrade to 1.4 from git. After I upgrade, python can no longer find django. Here's what I did: $ cd /usr/local/lib/python2.6/dist-packages $ sudo mv django/ django-13034 $ sud

Re: Upgrading django on a mac

2012-04-07 Thread Larry Martell
ckage is apparently a subdirectory of the git repository. I did this: mv django django.git ln -s django.git/django django And now it's finding it. > > On Sat, Apr 7, 2012 at 3:33 PM, Larry Martell > wrote: >> >> I'm on a mac, running Mac OS X Version 10.5.8 (Leopard). I w

Re: Upgrading django on a mac

2012-04-09 Thread Larry Martell
> On Sat, Apr 7, 2012 at 3:54 PM, Larry Martell > wrote: >> >> On Sat, Apr 7, 2012 at 3:46 PM, Jonathan Baker >> wrote: >> > I'm guessing that your $PATH is configured to look for django in it's >> > old >> > location, and not the new

executing raw sql

2012-04-30 Thread Larry Martell
I'm trying to execute some raw sql. I found some code that did this: from django.db import connection cursor = connection.cursor() cursor.execute(sql) data = cursor.fetchall() But the cursor.execute(sql) is blowing up with: 'Cursor' object has no attribute '_last_executed' What is the best or p

Re: executing raw sql

2012-04-30 Thread Larry Martell
On Mon, Apr 30, 2012 at 12:46 PM, Larry Martell wrote: > I'm trying to execute some raw sql. I found some code that did this: > > from django.db import connection > cursor = connection.cursor() > cursor.execute(sql) > data = cursor.fetchall() > > But the cursor.ex

Re: executing raw sql

2012-04-30 Thread Larry Martell
On Mon, Apr 30, 2012 at 2:32 PM, Larry Martell wrote: > On Mon, Apr 30, 2012 at 12:46 PM, Larry Martell > wrote: >> I'm trying to execute some raw sql. I found some code that did this: >> >> from django.db import connection >> cursor = connection.curs

Re: executing raw sql

2012-04-30 Thread Larry Martell
On Mon, Apr 30, 2012 at 6:26 PM, Dennis Lee Bieber wrote: > On Mon, 30 Apr 2012 15:29:08 -0600, Larry Martell > declaimed the following in > gmane.comp.python.django.user: > >> >> But in django I am doing this: >> >> from django.db import conn

Getting checkbox value in controller

2012-05-01 Thread Larry Martell
I have a template that creates a text entry field and a checkbox. When the checkbox is unchecked, the text field is disabled and cleared, when it's checked, it's enabled, and the user may or may not have typed in it. In my controller I need to distinguish between the 2 cases when the checkbox is un

Re: Git migration

2012-05-03 Thread Larry Martell
On Thu, May 3, 2012 at 9:42 PM, Stanwin Siow wrote: > Hello there, > > Just wanted to enquire about a project that i have been working on. > > It was previously hosted on an svn repository however my supervisor then > decided to migrate it to GIT. > > my question here would be do i need to reinsta

1.4 on git

2012-05-05 Thread Larry Martell
Last month I set up a system and when I cloned django from git I got version 1.4. Now I an setting up another system, and when I clone django from git I get 1.5, and my app is failing. How I can get 1.4? I see a django-nonrel / django-1.4 but it says "Work in progress 1.4 port, DON'T USE" -- You

Re: 1.4 on git

2012-05-06 Thread Larry Martell
ac2b467bd71f807cad45e12a86aa371bd fatal: reference is not a tree: 6fbf282ac2b467bd71f807cad45e12a86aa371bd > 2012/5/6 Ramiro Morales >> >> On Sat, May 5, 2012 at 8:42 PM, Larry Martell >> wrote: >> > Last month I set up a system and when I cloned django from git I got >> > version 1.4. Now I an

Re: 1.4 on git

2012-05-06 Thread Larry Martell
On Sat, May 5, 2012 at 7:06 PM, Ramiro Morales wrote: > On Sat, May 5, 2012 at 8:42 PM, Larry Martell wrote: >> Last month I set up a system and when I cloned django from git I got >> version 1.4. Now I an setting up another system, and when I clone >> django from git I g

Re: 1.4 on git

2012-05-06 Thread Larry Martell
is > available locally. > > You need to get a checkout of the commit pointed to by the '1.4' tag. > IIRC you can achieve that with:: > >  git checkout 1.4 Ok, Thanks. I'll try that next time. I ended up just scp-ing the django dir from my working system. > On 5/6/12

derived fields and getattr

2012-05-23 Thread Larry Martell
I was asked to make a mod to a large django app that I didn't write. They wanted me to add a derived field to a query, e.g. select col1-col2 from table ... I did that and it works, but in some other part of the code it calls getattr(object, field) and when field == col1-col2 it blows up with"objec

Re: derived fields and getattr

2012-05-24 Thread Larry Martell
On Thu, May 24, 2012 at 2:27 AM, bruno desthuilliers wrote: > On May 23, 10:39 pm, Larry Martell wrote: >> I was asked to make a mod to a large django app that I didn't write. >> They wanted me to add a derived field to a query, e.g. select >> col1-col2 from table ... &

Re: derived fields and getattr

2012-05-24 Thread Larry Martell
On Thu, May 24, 2012 at 9:29 AM, bruno desthuilliers wrote: > On May 24, 3:44 pm, Larry Martell wrote: >> On Thu, May 24, 2012 at 2:27 AM, bruno desthuilliers >> >> wrote: >> > On May 23, 10:39 pm, Larry Martell wrote: >> >> I was asked to make a mod

Re: derived fields and getattr

2012-05-25 Thread Larry Martell
On Fri, May 25, 2012 at 2:24 AM, bruno desthuilliers wrote: > > On May 24, 11:50 pm, Larry Martell wrote: >> I got this to work by adding the derived field to the drill down query >> with queryset.extra, and then it was available with getattr. The only >> issue I had was

Re: derived fields and getattr

2012-05-25 Thread Larry Martell
On Fri, May 25, 2012 at 6:42 AM, bruno desthuilliers wrote: > On May 25, 2:32 pm, Larry Martell wrote: >> On Fri, May 25, 2012 at 2:24 AM, bruno desthuilliers >> >> >> I couldn't use the display name or the getattr failed. >> >> > ??? >

admin hangs deleting multiple users

2012-06-08 Thread Larry Martell
In my admin site, if I select multiple users, then select 'Delete selected users' and click 'Go', it hangs. I can delete one user at a time with no issues. There is nothing logged anywhere - not in any apache log nor in the mysql log. Where can I look for more info to debug this? -larry -- You r

dropping ForeignKey not reflected in admin

2012-06-15 Thread Larry Martell
I have a table that had a ForeignKey reference. In the admin screen for adding to this table there was a dropdown for that column. I want to get rid of that ForeignKey. I changed models.py and removed the ForeignKey column, bounced apache and altered the table and removed that column. In the admin

Re: dropping ForeignKey not reflected in admin

2012-06-15 Thread Larry Martell
ong table. > On Fri, Jun 15, 2012 at 11:37 PM, Larry Martell > wrote: >> >> I have a table that had a ForeignKey reference. In the admin screen >> for adding to this table there was a dropdown for that column. I want >> to get rid of that ForeignKey. I changed models.

Render time

2012-06-25 Thread Larry Martell
This is not strictly a django question, but I'm hoping someone here has solved this and can help me. I have a client that has a django app that collects a bunch of server side statistics on the users activities - e.g. what reports they run, the number of rows returned, how long the query took, etc.

Re: Render time

2012-06-25 Thread Larry Martell
On Mon, Jun 25, 2012 at 5:56 AM, bruno desthuilliers wrote: > On Monday, June 25, 2012 1:34:08 PM UTC+2, larry@gmail.com wrote: >> >>  Now they want me to add to that how long >> the browser takes to render the page > > > How would server code ever know this ? My assumption is that it would b

Using now in an if

2012-06-25 Thread Larry Martell
I'm trying to use now in an if like this: {% if value|date:"Ymd" == now "Ymd" %} This is failing with: 'Unused '"Ymd"' at end of if expression.' If I quote it: {% if value|date:"Ymd" == 'now "Ymd"' %} I don't get the syntax error, but the if does not evaluate to true when the dates match. I

Re: Using now in an if

2012-06-25 Thread Larry Martell
On Mon, Jun 25, 2012 at 6:26 AM, Daniel Roseman wrote: > > On Monday, 25 June 2012 13:05:24 UTC+1, larry@gmail.com wrote: >> >> I'm trying to use now in an if like this: >> >> {% if value|date:"Ymd" ==  now "Ymd" %} >> >> This is failing with: 'Unused '"Ymd"' at end of if expression.' >> >> If

Re: Render time

2012-06-26 Thread Larry Martell
On Mon, Jun 25, 2012 at 6:56 AM, Melvyn Sopacua wrote: > On 25-6-2012 14:00, Larry Martell wrote: >> On Mon, Jun 25, 2012 at 5:56 AM, bruno desthuilliers >> wrote: >>> On Monday, June 25, 2012 1:34:08 PM UTC+2, larry@gmail.com wrote: >>>> >>&g

Re: Render time

2012-06-26 Thread Larry Martell
On Mon, Jun 25, 2012 at 9:04 PM, Andy McKay wrote: >> Now they want me to add to that how long >> the browser takes to render the page after it gets the data. > > You can use the navigation timing API: > > https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html > > We use

javascript in django template not executed when request is sent via ajax

2012-06-29 Thread Larry Martell
I have a django template that has some javascript/jQuery code in it that defines some keyup event handers. If a user goes to the URL directly the javascript is executed, and the event handers all work fine. There is also a field that they can type in that triggers the same URL request to be sent vi

Re: Render time

2012-06-29 Thread Larry Martell
On Mon, Jun 25, 2012 at 9:04 PM, Andy McKay wrote: >> Now they want me to add to that how long >> the browser takes to render the page after it gets the data. > > You can use the navigation timing API: > > https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html > > We use

Re: javascript in django template not executed when request is sent via ajax

2012-06-29 Thread Larry Martell
opacity: 1.0 }); style_preview_table(); } And I have verified that all the non javascript portions of the template are executed, but none of the javascript ones are. > > On Fri, Jun 29, 2012 at 11:45 PM, Larry Martell > wrote: >> >> I have a django

Re: javascript in django template not executed when request is sent via ajax

2012-06-29 Thread Larry Martell
meworks can extract script and inject it >> correctly to current DOM. Since you mention jquery I guess that you're using >> that for ajax queries so make sure that your $.ajax() has dataType attribute >> to set as 'html'. It should (according to docs) parse script

Re: javascript in django template not executed when request is sent via ajax

2012-06-30 Thread Larry Martell
On Sat, Jun 30, 2012 at 11:54 AM, Psamathos wrote: > If your web server is in fact serving the content with the incorrect > Content-Type header (You can verify this by inspecting the response in the > Net tab of Firebug or Chrome) jQuery can convert the response regardless of > the content-type if

Re: javascript in django template not executed when request is sent via ajax

2012-07-01 Thread Larry Martell
On Fri, Jun 29, 2012 at 2:45 PM, Larry Martell wrote: > I have a django template that has some javascript/jQuery code in it > that defines some keyup event handers. If a user goes to the URL > directly the javascript is executed, and the event handers all work > fine. There is also

Re: Fw: PLEASE HELP

2012-07-02 Thread Larry Martell
On Mon, Jul 2, 2012 at 11:45 AM, Cal Leeming [Simplicity Media Ltd] wrote: > Emily, > > Please refrain from sending chain/spam emails to the list, this isn't > acceptable. > > Also - on a site note, you really shouldn't be giving out your entire > mailbox by cc'ing everyone, this isn't very good p

Controlling access

2012-07-03 Thread Larry Martell
I have a client that asked me to add some new functionality to their app, and then they said 'This new functionality should be controlled in Django admin so that only the admin user can see it.' Is there a way to control this in Django admin? I know in the python code i can check to see if they're

Re: Controlling access

2012-07-03 Thread Larry Martell
ects for a good start. But there's nothing inherently built into Django admin that supports this, correct? > > > On Tue, Jul 3, 2012 at 1:39 PM, Larry Martell > wrote: >> >> I have a client that asked me to add some new functionality to their >> app, and then they

Re: Controlling access

2012-07-03 Thread Larry Martell
x27;t think so, but my client seems to. > > > > On Tue, Jul 3, 2012 at 1:51 PM, Larry Martell > wrote: >> >> On Tue, Jul 3, 2012 at 11:49 AM, Robert Steckroth >> wrote: >> > Yes, I have seen some very impressive admin media controls for websites >

Re: Controlling access

2012-07-03 Thread Larry Martell
On Tue, Jul 3, 2012 at 12:31 PM, Larry Martell wrote: > On Tue, Jul 3, 2012 at 11:55 AM, Robert Steckroth > wrote: >> Django is a very open-ended framework. The admin system is built around >> developer/user customization. > > > Yes, I realize that. But I was asking

Re: Render time

2012-07-05 Thread Larry Martell
On Mon, Jun 25, 2012 at 9:04 PM, Andy McKay wrote: >> Now they want me to add to that how long >> the browser takes to render the page after it gets the data. > > You can use the navigation timing API: > > https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html > > We use

Re: Render time

2012-07-05 Thread Larry Martell
On Thu, Jul 5, 2012 at 10:48 PM, Andy McKay wrote: >> I'm trying to use the Navigation Timing package to measure how long a >> page takes to be rendered. > > So you don't want to include all the lookups? Just the "rendering" part? Not sure what you mean by "lookups." I want to include everything

Returning nothing from a view

2012-07-06 Thread Larry Martell
I have a situation where I'm sending an ajax request to a function that updates a row in database. I then want to return control to the browser, with no changes to the page that was up. I am not returning anything from the function, and it's working the way I want, however I get an error in the bro

Re: Returning nothing from a view

2012-07-06 Thread Larry Martell
On Fri, Jul 6, 2012 at 2:47 PM, Tomas Neme wrote: > Just return an empty response, with a 200 OK code: > > return HttpResponse("") > > I'm not sure whether you can omit the "" Thanks. I did this: return HttpResponse(status=201) > On Fri, Jul 6,

Re: Render time

2012-07-07 Thread Larry Martell
On Mon, Jun 25, 2012 at 9:04 PM, Andy McKay wrote: >> Now they want me to add to that how long >> the browser takes to render the page after it gets the data. > > You can use the navigation timing API: > > https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html > > We use

Detecting browser type after login

2012-07-31 Thread Larry Martell
I've only been working with django for 6 months, and I'm not really clear on how the login process works. I have a client that has a login screen created by a template. It has a submit button with: In their urls file they have: (r'^accounts/login/$', login) In their views file they call login

Re: Detecting browser type after login

2012-08-01 Thread Larry Martell
On Tue, Jul 31, 2012 at 8:05 PM, Larry Martell wrote: > I've only been working with django for 6 months, and I'm not really > clear on how the login process works. > > I have a client that has a login screen created by a template. It has > a submit button with: > &g

Re: Detecting browser type after login

2012-08-01 Thread Larry Martell
ogin screen before the redirect. I don't know where the code that does this would live or how it would get invoked. As far as to why they want this, it doesn't really support IE, and they want to alert the user to that if that's what they're using. It's a custom app, n

Re: Detecting browser type after login

2012-08-01 Thread Larry Martell
use Javascript for this functionality? I'd typically only use this type of >> functionality to serve pages when javascript isn't enabled or you need to >> show various templates based upon the type of browser (for example, a Mobile >> browser). Just a suggestion. >> &

Re: Detecting browser type after login

2012-08-01 Thread Larry Martell
On Wed, Aug 1, 2012 at 1:52 PM, Larry Martell wrote: > On Wed, Aug 1, 2012 at 1:38 PM, Kurtis Mullins > wrote: >> Sorry for the double-message. Anyways, if you do want to do what that other >> person recommended, simply find the View that the user is redirected to >>

Re: Detecting browser type after login

2012-08-01 Thread Larry Martell
On Wed, Aug 1, 2012 at 1:56 PM, Larry Martell wrote: > On Wed, Aug 1, 2012 at 1:52 PM, Larry Martell wrote: >> On Wed, Aug 1, 2012 at 1:38 PM, Kurtis Mullins >> wrote: >>> Sorry for the double-message. Anyways, if you do want to do what that other >>> person

Re: Detecting browser type after login

2012-08-01 Thread Larry Martell
On Wed, Aug 1, 2012 at 3:57 PM, Larry Martell wrote: > On Wed, Aug 1, 2012 at 1:56 PM, Larry Martell wrote: >> On Wed, Aug 1, 2012 at 1:52 PM, Larry Martell >> wrote: >>> On Wed, Aug 1, 2012 at 1:38 PM, Kurtis Mullins >>> wrote: >>>> Sorry for t

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 7:06 AM, Gregory Thompson Jr. wrote: > I'd like to pass form data from one view to another. > > Here's my attempt: > > #Models.py > from django import forms > > class Textizer(forms.Form): > to_textize = forms.CharField(max_length=100) > > def __unicode__(self): >

Re: Detecting browser type after login

2012-08-02 Thread Larry Martell
use of the messages framework but at an > abstract level I picture it following a similar path. Thanks. I'm not familiar with the messaging framework. I'll look into that. > To try and clear up some of the questions/issues you mentioned specifically, > read below. > >

Re: Detecting browser type after login

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 9:13 AM, Andreas Schosser wrote: > Hi Larry > >> They want the dialog to pop up on top of the login screen before the >> redirect. I don't know where the code that does this would live or how >> it would get invoked. >> >> As far as to why they want this, it doesn't really s

Re: Detecting browser type after login

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 9:24 AM, Kurtis Mullins wrote: > Sorry I didn't catch this part. You could modify your "Login" view to check > the user agent and if it's an incompatible browser, and simply return a > template that tells them their browser is unsupported. I'd do this before > they even hit

Re: Detecting browser type after login

2012-08-03 Thread Larry Martell
On Thu, Aug 2, 2012 at 8:15 PM, Melvyn Sopacua wrote: > On 1-8-2012 21:52, Larry Martell wrote: >> On Wed, Aug 1, 2012 at 1:38 PM, Kurtis Mullins >> wrote: >>> Sorry for the double-message. Anyways, if you do want to do what that other >>> person recommended, s

Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
We have a django app that requires the users to login. For some testing we want to do, we want to disable this so the app can be run without logging in. Is there some way to easily do this? I've tried commenting out all the @login_required decorations, but then I was getting a 403. I tried commenti

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
more about your site. > Sorry! Yes, they do depend on a request.user object. Can I hard code the initialization of it? > > On Wed, Sep 5, 2012 at 11:18 AM, Larry Martell > wrote: >> >> We have a django app that requires the users to login. For some >> testing we want to d

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
ut logging in. I've tried to login from python, but I get a 403. I also tried using the requests module - that doesn't give me the 403, but doesn't log me in - it just returns the login page as if the login failed. > > On Wed, Sep 5, 2012 at 11:24 AM, Larry Martell > wrote:

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
backend = get_backends()[0] > user = user[0] > user.backend = "%s.%s" % (backend.__module__, > backend.__class__.__name__) #fake authentication > login(request, user) > > You can add that to your testing environnement MIDDLEWARE_CLASS

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
backend = get_backends()[0] >> > user = user[0] >> > user.backend = "%s.%s" % (backend.__module__, >> > backend.__class__.__name__) #fake authentication >> > login(request, user) >> > >> >

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
based template tags in all the templates for it to work properly. > > > On Wed, Sep 5, 2012 at 10:36 PM, Larry Martell > wrote: >> >> Thanks - but now I'm getting >> >> NameError: "global name 'get_backends' is not defined"

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Larry Martell
you wanted to simply > access using urllib. Maybe you could create a small script to extract a CSRF > token from the login page, login with a known (test) user, and continue > passing and extracting the CSRF token as needed? > > > On Wed, Sep 5, 2012 at 1:06 PM, Larry Martell >

  1   2   3   4   5   6   >