Re: Preview of Form

2021-05-29 Thread Jim Illback
page so changes could be made. With all this, you stay within Django and maintenance is simplistic, too. Hope I understood your situation. If not, just ignore this. Jim On May 29, 2021, at 11:40 AM, pankaj palmate mailto:pankajpalmate61...@gmail.com>> wrote: Yes using javascript On S

Re: Assistance for deploying django app to heroku

2021-04-24 Thread Jim Illback
I didn’t see a “createsuperuser" command. Was that done or is it part of your fixtures.json load? Jim On Apr 24, 2021, at 8:04 AM, Ejike Enyinnaya mailto:ejike.chib...@gmail.com>> wrote: Good day Kasper, Thanks for your response. The git commands I put in the email was j

Re: I have created a application in which i want to filter table between dates (from and to date) but i am not getting desired out put... Please guide me

2021-02-16 Thread Jim Illback
” and “results” are not the most meaningful names to use. Good luck! Jim On Feb 16, 2021, at 1:57 AM, neha bhurke mailto:bhurkene...@gmail.com>> wrote: hi Everyone , I have created a application in which I want to filter table between dates (from and to)dates But not getting a desired

Re: Show FK as input instead of drop down in admin

2021-01-27 Thread Jim Illback
, all applications using an update with a primary key to a large table has to write special form or view __init__() methods to limit primary key or keys shown. Otherwise, you have to wait for the page to build enormous primary key select tags. Why? Jim > On Jan 27, 2021, at 7:07 PM, Mike Dewhi

Re: Symmetrical, Self-referencing ManyToManyField with Through Table

2020-06-25 Thread Jim Shepherd
Nice solution. Thanks! On Thursday, June 25, 2020 at 5:49:23 PM UTC-4, Dan Madere wrote: > > I don't know of a way to configure the admin do that, but one solution > would be to use signals to notice when one-way records are created, then > automatically create the record for reverse

Re: Symmetrical, Self-referencing ManyToManyField with Through Table

2020-06-25 Thread Jim Shepherd
After reviewing the tests, I think I now understand what is going on. Basically, for symmetric ManyToManyField, Django creates entries for both directions automatically if the correct interface is used. From the test models: class PersonSelfRefM2M(models.Model): name =

Re: Symmetrical, Self-referencing ManyToManyField with Through Table

2020-06-25 Thread Jim Shepherd
On Thursday, June 25, 2020 at 10:26:25 AM UTC-4, Dan Madere wrote: > > I tried out the example code, and can replicate this. What's interesting > is that if I try removing the ContactConnection model, and the "through" > attribute, this allows Django to create the intermediate table on its own,

Re: Symmetrical, Self-referencing ManyToManyField with Through Table

2020-06-25 Thread Jim Shepherd
Mike, Thanks for your suggestions. Just a stab in the dark - have you tried giving from_contact a > related_name? > Yes, I have tried a few different combinations of providing a single related_name and various naming conventions when providing related_name on both ForeignKey fields without

Symmetrical, Self-referencing ManyToManyField with Through Table

2020-06-24 Thread Jim Shepherd
bly an Inline to show the Contacts on both sides of the ContactConnection? Thanks, Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-u

Re: HOW TO PROTECT SOURCE CODE DEPLOYED TO A REMOTE SERVER

2020-05-18 Thread Jim Armstrong
When I work on client projects, I deploy to a test server that is under my control. Once the project is complete and they have paid the invoice, I deploy to the production server under their control. At that point, I don't care if they have access to the code - my contracts give the clients all

Re: Multiple submit for same form refresh the page

2020-05-09 Thread Jim Illback
’): … Good luck! Jim Illback > On May 9, 2020, at 6:15 AM, Nirantar Kulkarni wrote: > > html template > name="sub_form"> > {% csrf_token %} > {{name}} >"wordcloud">WordCloud >&qu

how to request a feature

2020-02-17 Thread Jim
I found an app called redirects that gives me a way to create redirects via the admin UI. It works great, but I noticed that it doesn't support passing along the URL parameters to the new redirect target. It seems that this would be a good idea. I found that someone posted a snippet of code

Re: Directly Accessing Dictionary Values

2019-11-21 Thread Jim Illback
Check out this URL and the embedded Django link in the answers: https://stackoverflow.com/questions/1700661/how-to-access-array-elements-in-a-django-template. On Nov 20, 2019, at 10:25 AM, Andrew Stringfield mailto:loneso...@gmail.com>> wrote: I have not! I did see something about that on a

Re: Directly Accessing Dictionary Values

2019-11-20 Thread Jim Illback
Have you tried for the first element, and so forth? Of course, you have to keep track of the number of entries. > On Nov 20, 2019, at 5:57 AM, Andrew Stringfield wrote: > > Okie-dokie. Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "Django

Django 2.2.2 having problems with daylight savings time

2019-11-08 Thread Jim Illback
at 01:18:34? The -08 timezone designation proves that easily. Isn’t this a bug in Django? Is it limited to just version 2.2.2? Thanks for any help with this issue, Jim Illback -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: New user question: Where to put non-form validation code?

2019-07-24 Thread Jim Illback
chosen this seemingly “inversion” of processing - first models’ processes, then forms’? And, perhaps more importantly, where should this either/or logic should be placed so it will take effect? Thanks very much, Jim Illback On Jul 13, 2019, at 11:48 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Jim Illback
I think you can also add to your class (right under your template_name… for example) this statement: permission_required = ‘appname.permission_name' This will limit to logged on users (as below), and also to users who possess this permission. Jim On May 28, 2019, at 9:55 AM, Joe

Re: Error during template rendering

2019-05-23 Thread Jim Illback
it. Jim On May 23, 2019, at 12:23 PM, cixtus anyanwu mailto:sikky...@gmail.com>> wrote: Still got this erorr. thanks File "C:\Users\ANYANWU\djangogirls\myvenv\lib\site-packages\django\urls\resolvers.py", line 634, in _reverse_with_prefix raise No

Re: Error during template rendering

2019-05-23 Thread Jim Illback
Below, post is a DB row, not an ID as the URL.py requires. Change the view as: return render(request, ‘blog/post_details.html’, {‘pk’: posts[‘id’]}) Jim On May 23, 2019, at 11:10 AM, Rock N Roll Mühlbacher mailto:chmuhlbache...@gmail.com>> wrote: Am Donnerstag, 23. Mai 2019 20:06:31

Re: Is it possible to value based on another aggregation?

2019-05-21 Thread Jim Illback
Sorry this is late. I’d use the annotate to get the Max of one FK. Then, do a query on the other FK table with inverted order_by and use the [0] notation to just retrieve the latest row. It is 2 queries, but FK processes are indexed and should be fast. Hope this helps. Jim Illback On Apr 23

Re: formfield_overrides doesn't work

2019-05-12 Thread Jim Illback
etterthancomplex.com/2015/12/04/package-of-the-week-django-widget-tweaks.html. I hope this is useful for you. Jim Illback On May 12, 2019, at 3:03 PM, Tim Johnson mailto:t...@akwebsoft.com>> wrote: * Joe Reitman mailto:jreitma...@gmail.com>> [190512 13:34]: Tim, I found this in

Re: Why isn't user.photo being saved in UpdateView?

2018-12-01 Thread Jim Wombles
{% block title %}{{ user.username }}{% endblock %} {% block content %} {{ user.username }} {% csrf_token %} {{ form|crispy }} Update {% endblock %} On Friday, November 30, 2018 at 5:06:33 PM UTC-5, Jim Wombles wrote: > > For some reason

Why isn't user.photo being saved in UpdateView?

2018-11-30 Thread Jim Wombles
For some reason, the updateview will save all of the other user fields (and update them if changed) to the database. Do I need to handle the user.photo field differently? # views.py class UserUpdateView(LoginRequiredMixin, UpdateView): model = User fields = ["name", "photo", "city",

unable to do migrate when defining custom user model

2018-11-26 Thread Jim Lamb
Send us some code -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Logging a button click

2018-11-26 Thread Jim Lamb
I am trying to log a button click from a template. Can someone please help??? view.py from django.shortcuts import render from .models import UploadFile from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger import

Re: Django performance issue that's troubling

2018-08-24 Thread Jim Illback
Op 24 aug. 2018, om 21:28 heeft Jim Illback mailto:subaru...@hotmail.com>> het volgende geschreven: Vijay, your suggestion worked. I had tried this previously but it was using a FBV and it didn’t work. But with this CBV app, it works perfectly. Thanks. Matthew, I’ll definitely keep you

Re: Django performance issue that's troubling

2018-08-24 Thread Jim Illback
Vijay, your suggestion worked. I had tried this previously but it was using a FBV and it didn’t work. But with this CBV app, it works perfectly. Thanks. Matthew, I’ll definitely keep your suggestion in mind - maybe back on my FBV application if I refactor! Thanks much to both of you! Jim

Re: Django performance issue that's troubling

2018-08-24 Thread Jim Illback
Matthew, thanks - that was my original code, but even hidden, it has to fill in all possible values - 37K - so it takes multiple seconds. Vijay, I’ll try your suggestion. Thanks much, Jim On Aug 24, 2018, at 11:01 AM, Matthew Pava mailto:matthew.p...@iss.com>> wrote: You can keep the

Re: Django performance issue that's troubling

2018-08-23 Thread Jim Illback
and override the View’s post method by aftering is_valid(), but it always returns invalid expression errors. What am I missing? Thanks much again - Jim On Aug 23, 2018, at 3:48 PM, Vijay Khemlani mailto:vkhem...@gmail.com>> wrote: Maybe your update form has a field related to a

Django performance issue that's troubling

2018-08-23 Thread Jim Illback
where to look for improving the performance? Why all the involuntary context switches? Why the large domLoading time? Thanks in advance - Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Django DateField

2018-07-05 Thread Jim Illback
Add another field, say asap = model.BooleanField(default=False), sort by asap, date in reverse. The field asap True values will be sorted first, then the asap False will be sorted by date. You may want to ensure asap = False only if date is not None. On Jul 5, 2018, at 10:05 AM, 'dtdave' via

django.contrib.admin

2018-06-29 Thread Jim Lamb
How can I override the list_display to add fields in my admin console for users? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-30 Thread Jim Illback
alue(s) needed in __init__() ... That is pretty much it - simple if you have the proper documentation on how to initialize forms. Jim On Apr 27, 2018, at 11:39 AM, Jim Illback <subaru...@hotmail.com<mailto:subaru...@hotmail.com>> wrote: Absolutely agree. The “instance” (your no

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-27 Thread Jim Illback
. Thanks for the inputs, Matthew. I hope I’ve made it clearer. If you think there’s a better overall approach, I’m all ears! Jim On Apr 27, 2018, at 11:01 AM, Matthew Pava <matthew.p...@iss.com<mailto:matthew.p...@iss.com>> wrote: That ID in the URL should be taken care of in the view,

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-27 Thread Jim Illback
I also need to have the specific ID specified in the URL, so that is the other part needed. I’ve successfully done your suggestion for CreateView. Now, I just can’t seem to get UpdateView to work properly. Thanks much! Jim On Apr 27, 2018, at 9:20 AM, Matthew Pava <matthew.p...@iss.

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-27 Thread Jim Illback
it is displayed? Thanks for any help to answer this question. Jim Illback On Apr 25, 2018, at 10:41 AM, Jim Illback <subaru...@hotmail.com<mailto:subaru...@hotmail.com>> wrote: I wondered if anyone has had to alter the queryset behind a model form’s foreign key field which presents as a

Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-25 Thread Jim Illback
I wondered if anyone has had to alter the queryset behind a model form’s foreign key field which presents as a model choice field? Briefly, I have a client attribute table with the foreign key to a chore/time table. For an add of the client attribute table, I want to limit entries to unassigned

Re: Polls tutorial suggested mysite/mysite/urls.py improvement

2017-08-26 Thread Jim Fuqua
I agree. Anyone experienced in Django would not be confused. I have been away from Python for over ten years and totally new to Django. There are a number of such issues in the tutorial that got me "off track". A useful feature for the total novice would be a link to a folder with a

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread Jim Illback
n around and comment out that same code, uncomment the real code shown above, and run migrations again. It works, but it seems a bit awkward. Has anyone else had this issue? Or am I doing something wrong? Thanks much, Jim Illback On Aug 18, 2017, at 1:21 AM, James Bennett <ubern...@gmail.c

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread Jim Illback
anyone else had this issue? Or am I doing something wrong? Thanks much, Jim Illback On Aug 18, 2017, at 1:21 AM, James Bennett <ubernost...@gmail.com<mailto:ubernost...@gmail.com>> wrote: On Thu, Aug 17, 2017 at 1:03 PM, Antonis Christofides <anto...@djangodeployment.

Re: Django form needs pagination and saved data - how????

2017-07-31 Thread Jim Illback
Super advice - thanks very much, James! Appreciate your help. Jim On Jul 30, 2017, at 5:55 PM, James Schneider <jrschneide...@gmail.com<mailto:jrschneide...@gmail.com>> wrote: On Jul 30, 2017 4:50 PM, "Jim Illback" <subaru...@hotmail.com<mailto:subaru...@hotmail.

Re: Django form needs pagination and saved data - how????

2017-07-30 Thread Jim Illback
house? On Jul 30, 2017, at 4:51 AM, James Schneider <jrschneide...@gmail.com<mailto:jrschneide...@gmail.com>> wrote: On Jul 28, 2017 5:56 PM, "Jim Illback" <subaru...@hotmail.com<mailto:subaru...@hotmail.com>> wrote: I use the latest versions of Djang

Django form needs pagination and saved data - how????

2017-07-28 Thread Jim Illback
} } return hold; } } function strToArray(txt) { var array = []; var i = 0; var j = 0; var len = txt.length; for (i=0; i < len; i++) { if (txt[i] == ",") { array.push(txt.substring(j, i)); j = i+1; } } return array; } {% endblock content %} Thanks for any h

Re: saving data from both a model and a derived model

2017-05-24 Thread Jim Anderson
is derived from models.Model. PriorityItemType and ItemType are classes that are part of a library and which I have minimal control over, so figure them as constants that cannot be changed. Jim The relevant code is as follows: >From ItemType.py [code] class ItemType(models.Mo

Re: tutorial on using dbshell?

2017-05-23 Thread Jim Anderson
James, Thank you, again. I have install the sqlite command line package and all is working for me. Jim A. On Mon, May 22, 2017 at 6:35 PM, James Schneider <jrschneide...@gmail.com> wrote: > > > On May 22, 2017 3:07 PM, "Jim Anderson" <jjanderson52...@gmail.com&g

Re: tutorial on using dbshell?

2017-05-22 Thread Jim Anderson
= /home/jja/...FINISHED settings.pyCommandError: You appear not to have the 'sqlite3' program installed or on your path.* Am I invoking it properly? Do I have to change my configuration? Jim A. On Mon, May 22, 2017 at 5:28 PM, James Schneider <jrschneide...@gmail.com> wrote: > >

Django Permissions

2017-03-06 Thread Jim Lamb
I am trying to give add to the django permissions when you add a Type to a Source with the following models.py I would like it to be from __future__ import unicode_literals from django.db import models """Class for Data Sources""" class Source(models.Model): display_name =

Django Permissions

2017-03-06 Thread Jim Lamb
I am trying to add django permissions when a type add a source iusing the following model from __future__ import unicode_literals from django.db import models """Class for Data Sources""" class DataSource(models.Model): display_name = models.CharField(max_length=20) code_name =

DateTimeField, auto_now_add, and makemigrations

2016-10-19 Thread Jim
Hello, Having trouble with something on which the documentation seems clear to me. I'd greatly appreciate any help. I wanted to add a field to a model showing when a user signed on. I thought this is right. signup_datetime = models.DateTimeField(auto_now_add=True) But python3

Re: "Error creating new content types" with multiple DB router

2016-04-12 Thread Jim T
d you ever find the solution to this? Thanks -Jim On Tuesday, December 15, 2015 at 4:30:25 PM UTC-5, Carlton Gibson wrote: > > Hi, > > Using multiple DBs, with most models in the "default" db but models for a > single app being stored in a second DB, I've more or less

sqlite3 “OperationalError: no such table” on threaded operation

2016-01-08 Thread Jim Bell
By everything I read in the docs, both Django and py-sqlite3 should be fine with threaded access. (Right?) But the attached code snippet fails for me. The operations in the main thread work, but not in the thread(s) I create. There I get: File

Class Based Views tutorials

2015-01-06 Thread Jim Wombles
Two Scoops of Django is definitely the book you are looking for. I don't know if it's out for 1.7 yet, but I purchased the book for Django 1.6 and it covers l of the best practices that you won't read about just from the Django docs. -- You received this message because you are subscribed to

Re: Access Model data from a ModelFormset form

2013-03-12 Thread Jim Kalafut
Thanks Tom & C. Kirby for the suggestions. Pulling data off of .instance seems to work fine and is exactly what I'm looking for. Regards, Jim On Tuesday, March 12, 2013 9:28:23 AM UTC-7, Tom Evans wrote: > > On Tue, Mar 12, 2013 at 2:24 PM, Jim Kalafut <kal...@gmail.com>

Access Model data from a ModelFormset form

2013-03-12 Thread Jim Kalafut
by each form. Is there a straightforward way to get at that data, or configure the ModelFormset in a way that I can accomplish this? My hack approaches so far are ugly to the point that it is cleaner to just create a set of form/model pairs myself and send them to the template. Thanks, Jim

Re: Custom jQuery in admin

2013-01-11 Thread Jim Thaxton
I'm not sure about your original problem but prefixing it with django will make use of Django's jquery namespace: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions Django admin Javascript makes use of the jQuery library. > To avoid

Re: CSS not rendering on local server development

2012-10-02 Thread Jim Wombles
rver? > > Cheers, > > JJ > > On Tuesday, October 2, 2012 11:23:11 PM UTC-4, Jim Wombles wrote: >> >> Greetings, >> >> I am at a loss as to why local server is unable to render the css and js >> files. I have the static_dirs setting correct and the href

CSS not rendering on local server development

2012-10-02 Thread Jim Wombles
files returning an Internal Server Error 500 Any idea what may be going on ? Thanks for any advice. Jim Fanbouts.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@google

Re: convert str to datetime

2012-06-25 Thread Jim Thaxton
The parseutil module is very handy when converting a formatted string into a datetime object. Here's the module: http://labix.org/python-dateutil And here is a stackoverflow post with a number of examples: http://stackoverflow.com/questions/127803/how-to-parse-iso-formatted-date-in-python On

Re: Admin user privilege elevation (how to prevent it)

2012-05-12 Thread jim
On Fri, May 11, 2012 at 10:11 PM, Josh Cartmell wrote: > I work a lot with Mezzanine which is a CMS that uses Django. A > security issue was recently revealed where an admin user, lets call > him A, (they can post rich content) could put a cleverly constructed > javascript

Re: Sending data to the server

2012-03-26 Thread jim
Do you have CSRF protection enabled? https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ It will 403 POST requests unless they have the right token. Jim On Sun, Mar 25, 2012 at 11:24 PM, drk <darkiii...@gmail.com> wrote: > Hi, so I have a application that works offline (with loc

preventing data from getting saved to the backend database?

2011-12-27 Thread Jim
I'm a newbie reading documentation, and this question may well be answered by something I havent read yet, but anyway... My understanding so far is that django incorporates a back-end database (in my case built in sql3 on windows) to which all model related data from forms gets posted. I'm

Re: Trying to create django app to view alarms

2011-12-27 Thread Jim
On Dec 23, 2:29 pm, Python_Junkie wrote: > I think that building the python code that performs your logic is a > great way to start, and not getting bogged down with django is a great > way to get started. > > There are several (relatively straight forward) pieces

Trying to create django app to view alarms

2011-12-23 Thread Jim
to implement my existing python code in the .py file to create a Django solution? Thanks for any advice. Jim -- 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 unsubs

Re: urls.py?

2011-12-09 Thread Jim Byrnes
On 12/09/2011 03:06 AM, Reinout van Rees wrote: On 09-12-11 01:28, Jim Byrnes wrote: from django.conf.urls.defaults import * from mysite import views from mysite.views import hello, current_datetime, hours_ahead, display_meta from django.contrib import admin from mysite.contact import views

Re: urls.py?

2011-12-08 Thread Jim Byrnes
ontact and still get the error. Regards, Jim On 09/12/2011 12:10 PM, "Jim Byrnes"<jf_byr...@comcast.net> wrote: I am trying to learning django by working my way through The Definitive Guide to django (vers 1.1). I am running django 1.1.1 on Ubuntu 10.04. I get the follow

urls.py?

2011-12-08 Thread Jim Byrnes
appreciate any help you could give me in figuring this out. Thanks, Jim -- 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 grou

Using request.POST.copy() to get hidden field in html template

2011-11-30 Thread jim
to this? Thanks Jim -- 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 opti

Re: Detect runserver in settings.py?

2011-11-21 Thread Jim
On Nov 21, 5:29 pm, Simon Bächler <s...@feinheit.ch> wrote: > if 'runserver' in sys.argv: Thank you, Simon. Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Detect runserver in settings.py?

2011-11-21 Thread Jim
way that Django is running. Regards, Jim -- 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...@g

An application for hierarchical tagging?

2011-10-10 Thread Jim
e 10 tree, but I anticipate a fairly large tree (a hundred branches, perhaps). In the past when I needed to do this I used mptt and rolled my own. That was a few years ago. Googling didn't find me anything else. Does anyone know if there of a more generic solution at this point? Thank you, Jim

Re: spam in response to posting to this list

2011-08-29 Thread Jim Louis
Hello, I am having the same issue with my google group. If someone who is a manager of this group can email me. maybe we can see if the same email address is on both our groups causing the problem. My group is completely different focus from This group. j...@bestmeetings.com Thank you, Jim

Tips for setting up multiple databases routing in Django

2011-08-24 Thread Jim
First of all, I would like to thank Reinout van Rees ( http://reinout.vanrees.org/) for his helpful suggestions. Suppose you have two databases, 'default' and 'test', and one app, 'books'. And you want to store the models in books in the database 'test'. According to the guide from Django

Re: How to make an app independent on a specific site?

2011-08-23 Thread Jim
BTW, the way I posted above isn't so elegant. Is there a better way to do this? Any thoughts? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

How to make an app independent on a specific site?

2011-08-23 Thread Jim
Greetings, everyone. I am new to Django, and much of my knowledge comes from the Django book version 2 . In the book, a site, mysite, is created for demo purposes. And an app, books, is also created for demo purposes. In the file, mysite/books/admin.py, there

Re: Problems on using multiple databases

2011-08-23 Thread Jim
Still stuck on this problem. Can anybody help me out, please? It would be much appreciated. -- 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/-/K9twgNZcE4IJ.

Problems on using multiple databases

2011-08-22 Thread Jim
/tao.com/mysite/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 234, in execute return Database.Cursor.execute(self, query, params) django.db.utils.DatabaseError: no such table: django_content_type Any help would be appreciated. Thank you very much. Jim -- You received this messag

mod_wsgi cannot load MySQLdb

2011-08-22 Thread Jim
Hello folks, This probably has been discussed many times, but I still can't find any solution yet. Basically, it turns out that python can load MySQLdb just fine, but Apache can't load MySQLdb from the wsgi script. I am using python2.7 in a virtual environment created by virtualenv. Here is

Re: Import problem

2011-08-21 Thread Jim
You are right, SleepyCal. I changed global to something else, and the import issue was solved. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: How to create a sub-app directly

2011-08-21 Thread Jim
Thank you, folks. I am new to django. I read a blog the other day that suggests put all applications under a common directory, such as apps, to make the site directory neat, and I think that seems a good idea. That's why I thought it would be wonderful if manage.py could make an app under a

How to create a sub-app directly

2011-08-21 Thread Jim
/, but neither worked. So, my current work-around is to create a sub-app under mysite/ first, then move it into apps/ manually. But that seems dumb, and I suspect there is a simpler way to do this. Thanks for reading this. Any help is certainly appreciated. Jim -- You received this message

Import problem

2011-08-21 Thread Jim
^ SyntaxError: invalid syntax >>> from global.models import NavItem File "", line 1 from global.models import NavItem ^ SyntaxError: invalid syntax Now I am running out of ideas about what went wrong. I know this is a bi

Re: Defining global names

2011-03-18 Thread Jim Thaxton
Can you set it in the settings.py file for your project? You can then import the Django settings in your views with: from django.conf import settings and call the variable with settings.my_var_name when needed. -- You received this message because you are subscribed to the Google Groups

Putting content_type on a different class for a generic relation?

2011-03-02 Thread Jim D
I've got two models. Here's what I'm trying to do: class InterestSet(models.Model, MailChimpAPIMixin): name = models.CharField(help_text="The interest grouping to add. Grouping names must be unique.", max_length=128, unique=True) content_type = models.ForeignKey(ContentType, blank=True,

Re: Does loaddata in fact save objects to DB with a raw save? Or is this a bug?

2011-01-14 Thread Jim D.
> loaddata saves object created via deserialization, which pass raw=True to > the model's save_base, see: > > http://code.djangoproject.com/browser/django/trunk/django/core/serial... Thanks Karen. That's exactly the answer I was looking for. -- You received this message because you are

Does loaddata in fact save objects to DB with a raw save? Or is this a bug?

2011-01-13 Thread Jim D.
I was just now researching some options for how to manage the way certain post_save/pre_save signals can interfere with fixture loading during tests, when I happened upon this ticket: http://code.djangoproject.com/ticket/12610 Which says: "There is already a hook to check for this - data saved

Re: BrightonPy event: The Why and How of Automated Testing with Python and Django

2010-11-04 Thread Jim Purbrick
The video and slides for this talk are now online here: http://jimpurbrick.com/2010/11/04/why-and-how-automated-testing-python-and-django/ Cheers, Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Strange Filter Behaviour With UUIDField

2010-10-21 Thread Jim Purbrick
the id field when the primary key is a UUIDField (but not when it's an AutoField) in order for the auth tests to pass. Am I missing something here? Should the UUIDField or the User model be doing something else in order for the "group__user=user_obj" filter to work? Cheers, Jim --- backe

Re: Preventing code from running during user tests

2010-09-16 Thread Jim D.
the documentation for signals. On Sep 16, 5:13 pm, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Fri, Sep 17, 2010 at 6:15 AM, Jim D. <jim.dal...@gmail.com> wrote: > > I have some code that calls a third-party API in a Django application > > I'm working on, which could be

Preventing code from running during user tests

2010-09-16 Thread Jim D.
I have some code that calls a third-party API in a Django application I'm working on, which could be triggered at various points throughout a project. I would like to ensure that the API itself doesn't actually get called at all during test mode, much the same way that Django itself swaps out the

Re: How do you avoid this race condition in Django?

2010-09-06 Thread Jim
Maybe I'm not understanding the question but I'd freeze the row in the database, do the work, and then unfreeze the row. Jim -- 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...@google

Re: Touch-ing django.wsgi doesn't reliably reload source code

2010-08-22 Thread Jim
> Graham Thank you; that solved my problem. That was a big help to me. I bought a couple of things from your wish list -- I hope that your child enjoys them. Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Touch-ing django.wsgi doesn't reliably reload source code

2010-08-21 Thread Jim
But obviously I'm not understanding something. I wonder if anyone has a suggestion about how I am going wrong? I was hopeful of finding a way to accomplish this without having to restart apache from a cron job. Thank you, Jim -- You received this message because you are subscribed to the Google Groups

Re: passing a keyword argument from form to a field in that form

2010-08-03 Thread Jim
no problems. Thank you, Daniel; it is helpful to know that I have the right approach but must have a bug somewhere. I'll have another whack at it-- sometimes a nights sleep makes plain some imbecility on my part. :-) Jim -- You received this message because you are subscribed to the Goog

passing a keyword argument from form to a field in that form

2010-08-02 Thread Jim
amount of looking at the documentation, the source, and googling, although no doubt I didn't do it right. Can someone give me a hint about how I should do it? I'd be grateful. Jim -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: check md5sum on an uploaded file

2010-07-15 Thread Jim
Could you clarify what you want to do beyond saving the file somewhere and running md5 on it? -- 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,

Re: How set initial form field value in the view function?

2010-07-04 Thread Jim
) won't help you. Or possibly you want to override the __init__ method of the form? Jim -- 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

Unsubsubscribe

2010-06-06 Thread Jim Norman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 How do I unsubscribe from this list? Jim Norman -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwMVVMACgkQ677kSNWvnhS3EQCeO2OguYmNhKiyywl2HqXnLslF

Re: Performing an action on model.save() but not on update

2010-04-26 Thread Jim N
Nick, Thanks very much. That worked! I can't work out why my code didn't though (or rather, worked twice). -Jim On Apr 23, 6:37 pm, Nick Serra <nickse...@gmail.com> wrote: > Try this out and see what happens: > > def _hook_post_save_answer(instance, created, s

Re: Performing an action on model.save() but not on update

2010-04-23 Thread Jim N
t will be true or false depending on if > > > the object is being created or updated. Check out the post_save > > > documentation:http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.si... > > > > On Apr 23, 3:32 pm, Skylar Saveland <skylar.savel...@gm

Performing an action on model.save() but not on update

2010-04-23 Thread Jim N
on an update. self.question.increment_responses() # <-- I don't want to do this either. Or in more readable form: http://dpaste.de/I2IR/ TIA! -Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

  1   2   3   >