Re: passing data to template

2017-06-15 Thread Mike Dewhirst
On 16/06/2017 12:12 PM, sum abiut wrote: Is it possible to pass data from two different django functions to a one template in a single for loop? Yes. The general way to do that (and pretty much all Django things) is to write a "view" which can contain as many functions as desired and fetch as

Re: display a field from last updated row

2017-06-15 Thread Mike Dewhirst
On 16/06/2017 12:01 PM, sum abiut wrote: Hi, i am having trouble trying to figure this out. I have a table something as below. i want to write an sqlalchemy that query the table and then display the email address from the row that was last updated. Please point me to the right direction to

Internet Explorer question

2017-06-15 Thread Mike Dewhirst
arrow keys. I haven't had IE on any of my machines for decades. Am I going to have to test on IE? Ideas? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Re: passing data to template

2017-06-14 Thread Mike Dewhirst
On 15/06/2017 12:07 PM, sum abiut wrote: I try to perform a division on the tuple but i am getting an error. I have added another column call Gl rate. i try to perform the division lin {{a.1/a.0}}but im geting an error. not sure what i am doing wrong here. You are asking the template to perfor

Re: How to know when a record is added to or removed from a many to many relationship?

2017-06-13 Thread Mike Stoddart
Ah of course, why didn't I think of that! Thanks. On Tue, Jun 13, 2017 at 8:41 AM, Larry Martell wrote: > On Tue, Jun 13, 2017 at 7:54 AM, Stodge wrote: > > I have a model with a many to many relationship. I need to know when a > > record is added to or removed from the many to many. > > > > Is

Re: Is it possible to swap 1.8 and 1.10/1.11 Admin static files

2017-05-30 Thread Mike Dewhirst
a. Happy to let you know what happens ;) Cheers Mike On 31/05/2017 10:56 AM, 'Abraham Varricatt' via Django users wrote: How ... did you impose our will on this user? ;) I'd like to hear more ... for peaceful research purposes, of course. -Abraham V. On Monday, May 29, 2017

Re: Is it possible to swap 1.8 and 1.10/1.11 Admin static files

2017-05-29 Thread Mike Dewhirst
Cancel this question. We will force the user to comply with our reality. Cheers Mike On 16/05/2017 5:42 PM, Mike Dewhirst wrote: I have a user who is keen to revert to the "old" 1.8 look and feel for his company now that we have upgraded to 1.10. First question is it even possibl

Most efficient and scalable search strategy

2017-05-23 Thread Mike Dewhirst
#x27;t examined the content in detail yet. So the question is, how to quickly/efficiently detect that a substance is subject to the Montreal Protocol? Thanks for any pointers Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

Re: Is an upgrade from 1.6 to 1.11 as complicated as migrating from 1.1 to 1.6?

2017-05-16 Thread Mike Dewhirst
Go from 1.6 to 1.8.18 which is still supported and is easy. Buy some time. Actually all the upgrades are easy. Well up to 1.10. I skipped 1.9 and haven't tried to go to 1.11. Good luck Connected by Motorola NoviceSortOf wrote: > > >It's said here 1.11 is the recommended version of Django. >

Is it possible to swap 1.8 and 1.10/1.11 Admin static files

2017-05-16 Thread Mike Dewhirst
that's where I should be putting the admin files from 1.8. But then how do I tweak the settings so the Admin uses the preferred company static files for just that user? Maybe instead, there is a company specific preference I can establish to provide '/static/admin_1.8' for that us

Re: django install

2017-05-13 Thread Mike Dewhirst
On 14/05/2017 3:39 PM, Mike Dewhirst wrote: On 14/05/2017 10:15 AM, Dwaine Zeringue wrote: pip install Django in interpreter (via windows command prompt) continuously results in syntax errors, specifically, file line 1 pip install django "" I have written a couple of batch files fo

Re: django install

2017-05-13 Thread Mike Dewhirst
heq_req.bat This must be executed with the same two arguments you gave _cheq.bat. It will read the requirements created by _cheq.bat and install whatever is listed there. I put an app named "common" into this batch file so you can remove that or edit it as you like. Good luck M

Re: Admin css question for 1.10.7

2017-05-09 Thread Mike Dewhirst
On 9/05/2017 11:45 AM, Mike Dewhirst wrote: On 8/05/2017 11:02 PM, Melvyn Sopacua wrote: On Monday 08 May 2017 03:57:01 Tim Graham wrote: > You need to clone the Django repository and run the bisect command > from there: snip running /home/melvyn/hg/django-project/invert.sh Bis

Re: Admin css question for 1.10.7

2017-05-08 Thread Mike Dewhirst
ct/invert.sh e23e7b2ffe8e282adfd5c597df25c181413c5b3b is the first bad commit commit e23e7b2ffe8e282adfd5c597df25c181413c5b3b Author: elky Date: Mon Sep 7 00:28:14 2015 +0500 Fixed #11544 -- Removed !important rules in contrib.admin styles. Should I now contact elky

Re: Admin css question for 1.10.7

2017-05-07 Thread Mike Dewhirst
for line in lines: exists = expected in line if exists: break self.assertEqual(exists, False) I installed git and tried to do the bisecting thing but that didn't work for me (xxex3) C:\Users\mike\env\xxex3\s

Re: Admin css question for 1.10.7

2017-05-07 Thread Mike Dewhirst
The workaround for problem 2 is to start looking backwards from 1.10.7 to see if I can visually inspect the css files. I can install different versions and bisect manually. However, maybe the change is in the widgets or the forms? Thanks for any hints if you think that is the case. Mike On Sat

Admin css question for 1.10.7

2017-05-06 Thread Mike Dewhirst
I'm just (slowly) advancing from 1.8 to 1.11 and stopping for a short while at 1.10. I notice that help-text doesn't line up under the left edge of DecimalField fields the way it does for TextFields and most others. Is this a deliberate design decision? Thanks Mike -- PLEASE NO

choices choice utility

2017-05-05 Thread Mike Dewhirst
more pythonic. It is Friday after all :) Cheers Mike -- 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 pos

Re: How can I access obj in admin.py

2017-05-03 Thread Mike Dewhirst
, May 3, 2017 at 12:33 AM, Mike Dewhirst <mailto:mi...@dewhirst.com.au>> wrote: I want to adjust inlines based on a property of the object. class SubstanceAdmin(admin.ModelAdmin): class SolidInline(admin.StackedInline): pass class Liq

How can I access obj in admin.py

2017-05-02 Thread Mike Dewhirst
((LiquidInline), ) elif obj.physical_state = 3: return ((GasInline), ) Many thanks for a miracle :) Mike -- 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 i

Re: Django admin base.html template

2017-04-27 Thread Mike Dewhirst
For example - see below On 28/04/2017 3:38 PM, Mike Dewhirst wrote: I would like to suggest a small change to contrib/admin/templates/admin/base.html ... 33{% block userlinks %} 34{% if site_url %} 35{% trans 'View site'

Django admin base.html template

2017-04-27 Thread Mike Dewhirst
sers to the user-documentation instead. Thoughts? Mike -- 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 pos

Re: First models.py needs tuning

2017-04-20 Thread Mike Dewhirst
Rich I've run out of time this week. Maybe someone else can help. Mike On 21/04/2017 11:45 AM, Rich Shepard wrote: On Fri, 21 Apr 2017, Mike Dewhirst wrote: In the more usual scenario you specify your models using Python and let the Django ORM framework do the SQL. If that is your

Re: First models.py needs tuning

2017-04-20 Thread Mike Dewhirst
On 21/04/2017 7:48 AM, Rich Shepard wrote: On Wed, 19 Apr 2017, Mike Dewhirst wrote: You probably need a single FK plus a meta option of unique_together https://docs.djangoproject.com/en/1.8/ref/models/options/#unique-together Mike, Okay. What would be the correct syntax for PRIMARY KEY

How can i add one point to user after to press the button?

2017-04-20 Thread Mike Ru
I have Model. class UserProfile(models.Model): user = models.OneToOneField(User, related_name='userprofile') points = models.IntegerField(default=0) city = models.CharField(max_length=30, blank=True) about = models.TextField(blank=True) avatar = models.ImageField(upload_to='avat

Re: First models.py needs tuning

2017-04-18 Thread Mike Dewhirst
om/en/1.8/ref/models/instances/#django.db.models.Model.clean Cheers Mike If you would be willing to look at the module, show me how to write the two conditions above, and check syntax on the all 5 classes in it I will send you the file off the mail list. Rich -- You received this message because y

Re: Automatic reverse migrations

2017-04-17 Thread Mike Dewhirst
On 18/04/2017 9:58 AM, p...@qwil.co wrote: Thanks Andrew, will see what I can rustle up. Camilo -- blue/green deploys don't really help with this problem. As each application deployment still talks to the same database, once you have run the migration you can't just abandon your deployment, yo

Re: Unicode decoding error

2017-04-13 Thread Mike Dewhirst
Thanks Christophe Mike On 13/04/2017 2:31 AM, Christophe Pettus wrote: On Apr 12, 2017, at 02:26, Antonis Christofides wrote: Does this mean I should globally replace "str(" with "|six.text_type(" in a 2/3 codebase?| I don't think so; afaiu this must be don

Re: Unicode decoding error

2017-04-11 Thread Mike Dewhirst
self.a)| rather than |str(self.a)| (which returns bytes on Python 2). Tim Does this mean I should globally replace "str(" with "|six.text_type(" in a 2/3 codebase?| ??? Cheers Mike On Tuesday, April 11, 2017 at 11:18:02 AM UTC-4, Christophe Pettus wrote: I've run

[Solved?] Re: string theory and web woes

2017-04-05 Thread Mike Dewhirst
On 6/04/2017 2:44 PM, Mike Dewhirst wrote: I'm collecting strings from web page sources and storing extracted data in a TextField. If it is done again, it gets added into the TextField. My code goes something like ... If data not in textfield: insert_data(data, textfield) G

string theory and web woes

2017-04-05 Thread Mike Dewhirst
eding counselling. I'm using Python 3.5, Python 2.7, Django 1.8.18 with the Admin and plain TextField without any editor widgets. Thanks heaps Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: DATABASE DICTIONARY in Settings.py

2017-04-03 Thread Mike Dewhirst
On 4/04/2017 5:50 AM, alkhair...@mymail.vcu.edu wrote: Hey everyone, I'm new to Django and web development overall so please bare with me. I may be asking an incredibly stupid question. In the DATABASES dictionary in settings.py: DATABASES = { 'default': { 'NAME': 'somethin

Re: django admin datepicker

2017-03-30 Thread Mike Dewhirst
On 31/03/2017 7:55 AM, sum abiut wrote: Hi, i am trying to use django admin datepicker on my custom form to have it show on two fields but when i run the app it only showing on one field, the start_date but not showing on end_date. can some please point me to the right direction. What hap

python-social-auth-django for Twitter

2017-03-28 Thread Mike Ru
I'm using python-social-auth-django. I' trying to login with Twitter. It works. But some symbols are added to my nickname. Why is it happening? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: AdminURLFieldWidget question

2017-03-26 Thread Mike Dewhirst
Declaring myAdminURLFieldWidget outside the ModelAdmin class is the answer! On 26/03/2017 6:32 PM, Mike Dewhirst wrote: How can I manipulate the link in an Admin URLField so it uses the normal HTML hyperlink attributes? I have a substance with ingredients in a self m2m relationship and I

AdminURLFieldWidget question

2017-03-26 Thread Mike Dewhirst
field_overrides = { URLField: {'widget': myAdminURLFieldWidget}, } However, I'm a bit lost in making it happen. Where do I learn more? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Tweaking the admin title to display the model name

2017-03-17 Thread Mike Dewhirst
dréas ... here's the entire change in 2 lines: {% extends "admin/change_form.html" %} {% block title %}{{ original }}{% endblock %} :-) Cheers Mike Regards, Andréas 2017-03-17 5:21 GMT+01:00 Mike Dewhirst <mailto:mi...@dewhirst.com.au>>: Currently in an admin

Tweaking the admin title to display the model name

2017-03-16 Thread Mike Dewhirst
be very useful. Thanks Mike -- 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, s

Re: new bee - starting to build web application based on python - Django - PostgreSQL (or) MYSQL

2017-03-16 Thread Mike Dewhirst
SD It would help to say if you have a particular web application in mind. What is it you would like to achieve? Mike On 17/03/2017 8:38 AM, SD wrote: Hi There, Am new to web development based on python,Django and PostgreSQL (or) MYSQL databases. I am able to build standalone applications

Re: Rename Table limiting the down of the system

2017-03-15 Thread Mike Dewhirst
On 15/03/2017 8:14 PM, Stefano Tranquillini wrote: Thanks, On Wed, Mar 15, 2017 at 9:43 AM, Mike Dewhirst <mailto:mi...@dewhirst.com.au>> wrote: On 15/03/2017 7:12 PM, Stefano Tranquillini wrote: Hi people. I've to do a migration for the database, specif

Re: Rename Table limiting the down of the system

2017-03-15 Thread Mike Dewhirst
e the data is protected. ALSO I have had migration squashing issues (circular references) since then. It may or may not be the reason but I think in hindsight I would squash all migrations prior to renaming the table. Good luck Mike Now, I'm using postgres and I've two servers using the s

Re: Migrations

2017-03-13 Thread Mike Dewhirst
o pay. Cheers Mike that squashmigrations caused. I have had issues in the past with removing a field from a model and basically having a simple pass statement for the model. I saw a ticket or some discussion somewhere about that issue elsewhere. I also have had issues when renaming models, e

Re: Migrations

2017-03-10 Thread Mike Dewhirst
On 11/03/2017 7:17 AM, Matthew Pava wrote: Does anyone else get a migraine when working migrations? Only when I try to game them. If I follow instructions they are magnificent. That said, what are your problems? Mike -- You received this message because you are subscribed to the Google

Re: Who can help me installing Django on windowsX machine?

2017-02-26 Thread Mike Dewhirst
led on most Linux systems. Or at least on the ones I use. Good luck and welcome Mike I know, what you are thinking at this point. why windows?? right?? but for the time being Yees, windows Works :) -- You received this message because you are subscribed to the Google Groups "Django

Re: Flattening model relationships (in APIs)

2017-02-21 Thread Mike Dewhirst
is always best to normalize as much as possible in the beginning and de-normalize only if performance becomes an issue. Also ... https://hackernoon.com/10-things-i-learned-making-the-fastest-site-in-the-world-18a0e1cdf4a7#.3l8n34dvk Mike On 22/02/2017 6:09 AM, Ankush Thakur wrote: I'm

Re: any idea for get_absolute_url in m2m categories

2017-02-19 Thread Mike Dewhirst
On 20/02/2017 4:00 PM, carlos wrote: Hi, any idea how to construct my get_absolute_url (127.0.0.1:8000/category-slug/id-slug-post ) for example i have my models like this class Category(...): name = CharField() slug = SlugField(.

Re: Is it possible to save children before parents?

2017-02-15 Thread Mike Dewhirst
ets saved at once in a single transaction? Thanks very much for taking all that effort Cheers Mike -- Melvyn Sopacua -- 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,

Re: Is it possible to save children before parents?

2017-02-14 Thread Mike Dewhirst
s in the children records. I looked at javascript once and nearly vomited. We'll save() twice until we get some funding then I'll hire a js person to let me off the hook ;-) Thanks again Cheers Mike Regards, Antonis Antonis Christofides http://djangodeployment.com On 02/15

Re: Is it possible to save children before parents?

2017-02-14 Thread Mike Dewhirst
this point I think a double save is easier than js Thanks again Mike On 14/02/2017 4:16 PM, Mike Dewhirst wrote: Derek, Antonis, Ludovic and Melvyn I've got a lot happening in the code because chemical mixtures and safety regulations are complex. I will attempt to radically simplify it

Re: Is it possible to save children before parents?

2017-02-13 Thread Mike Dewhirst
tions Much appreciated Mike On 14/02/2017 12:14 PM, Melvyn Sopacua wrote: P.S. I left two bugs in there, for now I'll leave them in as an exercise for the reader. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: Is it possible to save children before parents?

2017-02-12 Thread Mike Dewhirst
On 13/02/2017 1:12 AM, Derek wrote: Mike Not sure I understand your scenario completely, but can you not just add a post-save trigger that updates the parent field (in which the total is saved) after all the other saves have happened? Derek That does not work and is one of the ways I have

Re: Django doesn't load CSS file using static constant

2017-02-12 Thread Mike Dewhirst
print('STATIC_ROOT = %s%s%s' % (static_root, sp3, '(collectstatic dest)')) sp3 = " " * (col3 - len(static_url) - 9) print('STATIC_URL = %s%s%s' % (static_url, sp3, '(serve css, js etc)')) for i in enumerate(staticfiles_dirs,

Is it possible to save children before parents?

2017-02-11 Thread Mike Dewhirst
an be evaluated, the parent field updated and then the parent saved? Thanks Mike Django 1.8 Python 2.7 and 3.5 -- 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, se

Re: audit trail functionality in database model

2017-01-21 Thread Mike Dewhirst
o has moved on since then - but in a good way. Largely backward compatible. It is probably still all relevant and very valuable. Mike On 21/01/2017 11:15 PM, enrico baranski wrote: Hi all Django users, I'm quite new to Django and currently experimenting with the database model. Defining fiel

Re: Projects vs. apps

2017-01-16 Thread Mike Dewhirst
disciplined and part-guru you can make such apps public for us lesser mortals to install and save us from re-inventing that particular wheel. But that's another story :) Cheers Mike thanks, Thufir -- You received this message because you are subscribed to the Google Groups "D

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-15 Thread Mike Dewhirst
As you are a Django beginner I assume you will try one or two small projects before tackling a major one so just going with the standard User model should be no impediment in the early stages. Then maybe look through the docs to see how to customise/replace that User model. Cheers Mike a vi

RE: list? queryet? joining together

2017-01-13 Thread Mike Jones
Thanks for response I’ll try to answer as below in red From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Andrew Beales Sent: 12 January 2017 19:52 To: Django users Subject: Re: list? queryet? joining together Hi, just a couple of follow-up questions as

Re: browser testing

2017-01-05 Thread Mike Dewhirst
Antonis - that looks really good. Thanks for sharing ... Mike On 5/01/2017 7:20 PM, Antonis Christofides wrote: Some time ago I was in a small team of programmers and I thought it was unreasonable for everyone to learn Selenium, so I created django-selenium-clean, a front-end, which is much

Re: browser testing

2017-01-04 Thread Mike Dewhirst
than the other way around. This could be because of the difference in relative difficulty between the two. Selenium has a learning curve that makes it better suited to professional testers than, say, random client representatives doing UAT. On Wed, Jan 4, 2017 at 6:30 PM, Mike Dewh

browser testing

2017-01-04 Thread Mike Dewhirst
there? The objective is to help users to automate their acceptance testing and, like unit tests, keep adding new tests as new features are delivered. Thanks for any advice Cheers Mike -- You received this message because you are subscribed to the Google Groups "Django users"

Re: multiple databases - two questions

2017-01-02 Thread Mike Dewhirst
On 3/01/2017 12:32 PM, Fred Stluka wrote: Mike, Maybe you don't need a custom DB manager. Perhaps a simple DB router would suffice? It's a Django way to specify which DB to use based on which model is being used, whether it is being read/written, etc. That's the approach I to

Re: Admin - saveasnew to another database

2017-01-02 Thread Mike Dewhirst
say the staging server gets blown away frequently - use it at your peril! I do like your DRAFT notion. Thanks Mike On 3/01/2017 11:52 AM, Fred Stluka wrote: Mike, On 11/11/16 8:00 AM, Mike Dewhirst wrote: > ... My solution is to tell the users to avoid doing real work on the > staging se

Re: How can I access field values generically?

2016-12-22 Thread Mike Dewhirst
Very generous. Thank you. It looks as though you did get the model structure. Your first comment nails it because mixtures can have other mixtures as ingredients. I'm right into recursion nowadays :) Mike On 22/12/2016 7:48 PM, C. Kirby wrote: Ill be honest, I'm still not gettin

Re: How can I access field values generically?

2016-12-21 Thread Mike Dewhirst
On 21/12/2016 9:10 PM, C. Kirby wrote: Mike, I've done a lot of work with Model meta, and I'm pretty sure I can give you at least the bones of a solution, but I can't really get my head around the problem. Could you post a set of related models and what you would expect the resu

Re: How can I access field values generically?

2016-12-20 Thread Mike Dewhirst
e populated with ingredient data from the same fields. "\ "Edit as required. To retrieve that data again add an ellipsis (...) "\ "somewhere in the field and click [Save]" Any advice would be appreciated. And appreciation might involve red wine. Thanks Mike On 7/12/2016 9:38 AM, Mike De

Re: M2M Question

2016-12-15 Thread Mike Dewhirst
On 16/12/2016 8:52 AM, Matthew Pava wrote: I have a Document model that has an M2M-symmetrical field on itself. The idea is that we can “link” documents to other documents. It’s very simple to find the linked documents of a particular document, but is there an easy way to get all the linked

Re: makemigrations generates new migration when nothing has changed

2016-12-12 Thread Mike Dewhirst
On 13/12/2016 9:58 AM, Francis Fisher wrote: On Wednesday, 30 November 2016 22:43:55 UTC, Mike Dewhirst wrote: On 1/12/2016 3:56 AM, Francis Fisher wrote: > Any idea why makemigrations would fail to recognise that a migration > has already been generated? I think migr

How can I access field values generically?

2016-12-06 Thread Mike Dewhirst
: name = obj.substance.name text = obj.incompatibilities comment = "{0}\n{1}: {2}".format(comment, name, text) comment = comment.strip() if comment: self.incompatibilities = comment Thanks Mike -- You received

How can I access field values generically?

2016-12-06 Thread Mike Dewhirst
() if comment: self.avoid = comment if not self.incompatibilities: comment = "" for obj in state_objs: if obj.incompatibilities: name = obj.substance.name text = obj.incompatibilities comment = "{0}\n{1}: {2}".format(comment, name, text) comment = comment.strip() if comment: self.incompati

Re: makemigrations generates new migration when nothing has changed

2016-11-30 Thread Mike Dewhirst
On 1/12/2016 3:56 AM, Francis Fisher wrote: Any idea why makemigrations would fail to recognise that a migration has already been generated? I think migrations is seeing field choices differently each time it scans the model. Can you use a list rather than a tuple for choices? (Or vice versa

Re: request

2016-11-27 Thread Mike Dewhirst
Here is a good place to start ... https://www.djangoproject.com/ then continue here ... https://docs.djangoproject.com/en/1.10/intro/tutorial01/ Welcome On 28/11/2016 9:03 AM, Bhanu jamwal wrote: i am new to it please let me know the aims and steps regards Bhanu -- You received this message

Re: Admin - saveasnew to another database

2016-11-11 Thread Mike Dewhirst
To finish this thread, I have decided to abandon the attempt. My solution is to tell the users to avoid doing real work on the staging server. It exists only to check out new features. I feel better now. Thanks Melvyn and Tim Mike On 10/11/2016 11:08 AM, Mike Dewhirst wrote: On 10/11/2016

Re: localStorage to save answer to form until it is sent to server

2016-11-10 Thread Mike Dewhirst
On 11/11/2016 2:41 AM, Raniere Silva wrote: Hi all, I have some text area on my form that I expected that the user will take a few minutes to answer and I want to avoid them to need to type everything again if something happen (e.g. their device got out of battery). Something that I think I coul

Re: Admin - saveasnew to another database

2016-11-09 Thread Mike Dewhirst
ory. I'm skipping that one for the moment. I agree with Melvyn See below that it seems unusual to use Django's multi-database facilities to transfer data between staging and production. On Wednesday, November 9, 2016 at 4:51:39 AM UTC-5, Melvyn Sopacua wrote: On Wednesday

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-08 Thread Mike Dewhirst
python is probably your best guide. Mike https://docs.djangoproject.com/en/1.10/topics/auth/customizing/#extending-the-existing-user-model The docs mention using a django.db.models.signals.post_save <https://docs.djangoproject.com/en/1.10/ref/signals/#django.db.models.signals.post_save&g

Re: Admin - saveasnew to another database

2016-11-08 Thread Mike Dewhirst
ent ids in the destination database so all transfers will need to be done using queries. This is why piggy-backing on [Save as new] beats doing things either manually or programmatically in my own utility functions. Your thoughts? Mike On Tuesday, November 8, 2016 at 4:29:48 PM UTC-5, Mike D

Admin - saveasnew to another database

2016-11-08 Thread Mike Dewhirst
y own use. Which I have started but I can see it is going to get overly complex. Thanks Mike -- 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

multiple databases - two questions

2016-11-03 Thread Mike Dewhirst
oduction').get_or_create( name=subst.name, ) if create: pass # copy all subst attributes except id to prd_subst Q2. Is this a reasonable approach? Thanks for any hints Mike -- You received this message because you are subscribed to the Google Groups "D

multiple databases - two questions

2016-11-03 Thread Mike Dewhirst
f create: pass # copy all subst attributes except id to prd_subst Q2. Is this a reasonable approach? Thanks for any hints Mike -- 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

Re: Django Project Structure

2016-10-28 Thread Mike Dewhirst
On 28/10/2016 5:17 PM, Deep Shah wrote: I have read this, but still confused. What would be the best practices for this? Your email doesn't say what you have read ("this" above?) so the following recommendation may be a duplication. In any case I recommend Two Scoops of Django[1] for well rea

Re: Negative User ID's

2016-10-26 Thread Mike Dewhirst
On 27/10/2016 9:57 AM, mich...@zanyblue.com wrote: Hi, The Django contrib User model is used to create accounts in Django applications. I would like to keep accounts associated with real people separate from accounts created for mailing list and/or service accounts. I was planning on using

Re: transferring data between Postgres databases

2016-10-24 Thread Mike Dewhirst
On 25/10/2016 7:09 AM, Erik Cederstrand wrote: Den 24. okt. 2016 kl. 06.04 skrev Mike Dewhirst: I have a user who has done a lot of work (instead of playing) in the staging server and now wants to get that work into the production database. I'm about to research selective dump and

Re: transferring data between Postgres databases

2016-10-23 Thread Mike Dewhirst
Django app. Aaron, thanks for that. Do you know if it will handle a bunch of related records in many tables to be copied as a related "set" to the other database. Both databases have identical structures. M [0] - http://www.sql-workbench.net/ -A On Sun, Oct 23, 2016 at 9:04 PM, M

transferring data between Postgres databases

2016-10-23 Thread Mike Dewhirst
I have a user who has done a lot of work (instead of playing) in the staging server and now wants to get that work into the production database. I'm about to research selective dump and load capabilities of Postgres but in the meantime can anyone suggest any shortcuts? Thanks Mike -

Re: How to: Django development and debugging

2016-10-22 Thread Mike Dewhirst
Merge to trunk * Run unit tests * Repeat until all unit tests are working * Commit trunk in svn * Svn commences a Buildbot deployment on staging which succeeds if the tests all work * Occasionally create a production tag from trunk in svn * Manually edit a script on production to deploy the tag

Re: A Backup Model in Django?

2016-10-16 Thread Mike Dewhirst
-vWKY&hl=en&sa=X&ved=0ahUKEwil5vDrr-DPAhVJKWMKHTzYDAoQ6AEIKTAC#v=onepage&q=pro%20django%20keeping%20historical%20records&f=false If the notions suit your use-case you need to remember it was written for Django 1.0 and Python >= 2.3. It may contain traces of long-deprecated fe

Forbidden fix

2016-10-13 Thread Mike Dewhirst
Hope this helps someone. Cheers Mike -- 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 t

Re: Headless testing

2016-10-12 Thread Mike Dewhirst
There is also BuildBot which can be programmed to do anything on multiple client/slaves running any OS http://buildbot.net/ On 13/10/2016 1:09 PM, Avraham Serour wrote: Hi, In Linux you can just use selenium chrome or firefox or anything and set up xfvb for headless, I have no idea if such a

Re: Windows users: do the line endings created by startproject/startapp matter?

2016-10-12 Thread Mike Dewhirst
hat. If I did have a problem I would consider it my own responsibility to choose a different set of tools to resolve it. Not a Django issue IMO. Cheers (and thanks!) Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

Re: quasi-distributed system sharing data in django

2016-10-05 Thread Mike Dewhirst
egerField to the applicable model class in project A to store a copy of the primary key. Maybe use the migration and then the model save() method to populate it. At least then you would have a simple independent mechanism to find the corresponding record in B should you ever need to update t

Re: Model Inheritance across apps

2016-09-29 Thread Mike Dewhirst
has a fk to another model in Child.models.py? You can also use quotes to specify the model class here. Just omit the app name if they are in the same app. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: email console backend is silent

2016-09-29 Thread Mike Dewhirst
Thanks Tim Followed the code to the query to return users with the entered email address and that triggered a deeper look to check I was entering the correct email address. I wasn't. My bad. Django's good. Mike On Wednesday, September 28, 2016 at 4:31:34 AM UTC+10, Tim Graham wr

Re: Repetitve/Infinite migrations generated on ManyToManyField

2016-09-26 Thread Mike Dewhirst
On 27/09/2016 6:58 AM, Marvin Mednick wrote: I've the the following models related to a many-to-many relationship.  (Django 1.9.4 and sqlite) Each time I run makemigrations, it generates an AlterField migration, which migrate successfully executes (no errors), but running makemigrations

email console backend is silent

2016-09-25 Thread Mike Dewhirst
HTTP/1.1" 200 1911 [26/Sep/2016 09:30:44] "POST /admin/password_reset/ HTTP/1.1" 302 0 [26/Sep/2016 09:30:44] "GET /admin/password_reset/done/ HTTP/1.1" 200 1784 How do I start debugging this? Thanks Mike EMAIL_HOST = (my ISP's valid, pingable smtp host name) EMAI

Re: HTML Flexbox CSS

2016-09-25 Thread Mike Dewhirst
Completely off-topic but I have found the CSS documentation and advice on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ to be more effective and up-to-date than found on w3schools. w3schools always sorts to the top of the google page but you will see the developer.mozilla item th

Re: How to populate self._reverse_dict with a default language code ?

2016-09-18 Thread Mike Dewhirst
#x27;en-au' which seems to work for me so I think that is a reasonable format for it. Cheers Mike Le 2016-09-14 à 20:33, Mike Dewhirst a écrit : On 14/09/2016 11:43 PM, Etienne Robillard wrote: Hi, Is there a way to populate self._reverse_dict to contain a default language_co

Re: Import css in Django

2016-09-15 Thread Mike Dewhirst
BUG: CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } Mike Mike Dewhirstæ–¼ 2016å¹´9月16日星期五 UTC+8ä¸Šå ˆ8時43分17ç§’å¯«é “ï¼š On 16/09/2016 1:10 AM, Jonathan Cheng

Re: Import css in Django

2016-09-15 Thread Mike Dewhirst
On 16/09/2016 1:10 AM, Jonathan Cheng wrote: thx your code,though i cant run it in cmd That is correct. It is designed to be imported and called from settings.py. I'll send you a screenshot off-line Mike -- You received this message because you are subscribed to the Google Groups &q

Re: How to populate self._reverse_dict with a default language code ?

2016-09-14 Thread Mike Dewhirst
On 14/09/2016 11:43 PM, Etienne Robillard wrote: Hi, Is there a way to populate self._reverse_dict to contain a default language_code in case the setting USE_I18N is set to False? return self._reverse_dict.get("language_code", defaultlanguagecode) or try: languagecode = failing_routine

Re: Can't create editable foreign key field in Django admin: going to give up on django

2016-09-13 Thread Mike Dewhirst
anslation_word1") #word2 belongs to another word word2 = models.ForeignKey(Word, on_delete=models.CASCADE, related_name="Translation_word2") def __str__(self): return "{0} - {1}".format(word1.language, word2.language) On Monday, September 12, 2016 a

<    3   4   5   6   7   8   9   10   11   12   >