Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Mike Dewhirst
On 17/11/2015 12:33 PM, marcin.j.no...@gmail.com wrote: Mike, thanks. Â I have no migration directories, so assuming that it would not help. I just checked and I tested that on 1.8.5 So maybe step 0 is to downgrade and step 4 is to upgrade again. Cheers Mike Tim, also thanks. I&#x

Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Mike Dewhirst
On 17/11/2015 11:14 AM, marcin.j.no...@gmail.com wrote: Hi! After upgrade from 1.5 to 1.8.6 I'm trying to dump sql from models. I'm not using django migrations, and my db_router does not allow for migrations. Try this ... 1. Rename all the migrations directories if they exist 2. $~python ma

Re: save_formset in Admin prevents deleting children

2015-11-15 Thread Mike Dewhirst
On 16/11/2015 4:32 PM, Mike Dewhirst wrote: I've been trying to figure out why I can't delete child records displayed in the Admin. Finally tracked it down to this method in admin.py which when commented out restores the ability to check the Delete box and get rid of the child record o

save_formset in Admin prevents deleting children

2015-11-15 Thread Mike Dewhirst
instance.save() formset.save_m2m() How can I keep this and get Delete to work in the Admin? 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

Re: Domain Driven Development

2015-11-11 Thread Mike Dewhirst
useful if you worked out how to do it in a way we could all benefit. Good luck. 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

Re: Controlling access at table row level

2015-11-05 Thread Mike Dewhirst
On 5/11/2015 9:35 PM, Steve West wrote: Hi all I'm implementing a Django project in which individual table rows are marked as either private or public. Have you looked at https://github.com/django-guardian/django-guardian I need to be able to filter accesses to the tables in such a way that

Re: [1.8] Odd error on makemigrations when moving model to another application

2015-11-02 Thread Mike Dewhirst
migration file prior to migrating to use a forwards_func() method to get the data across and entrenched in its proper relations with other models on creation. Finally, when all is working I'd bravely drop the old model in a separate migration. hth Mike On Mon, Nov 2, 2015 at 4:34

Re: MySQL queries-connection to django

2015-10-28 Thread Mike Dewhirst
excellent tutorial ... https://docs.djangoproject.com/en/1.8/ ... which will take you step by step through the general learning curve. Welcome and good luck Mike so i have installed django,python and using Visual studio as interface, so my question is I have database name :*siddharth* Â in sql

Re: migrate error

2015-10-23 Thread Mike Dewhirst
, 2015 at 11:31:11 PM UTC+2, Mike Dewhirst wrote: On 22/10/2015 10:40 PM, Christoph Knapp wrote: > Hi, > I have a legacy database and used "python manage.py inspectdb > > models.py" to create a models.py file. After I modified the file all >

Re: Issues with django-storages and gunicorn processes

2015-10-23 Thread Mike Herring
AM UTC-4, Vijay Khemlani wrote: > > Media Library? I'm not aware of something like that in django-storages > > On Wed, Oct 21, 2015 at 5:22 PM, Mike Herring > wrote: > >> I am using django-storages to store media files in Amazon S3. >> >> Gun

Re: migrate error

2015-10-22 Thread Mike Dewhirst
which you don't need to install. In your models.py remove all models except your own, drop the database and try again. The models/tables created for you by Django and the Admin are ... auth_group auth_group_permissions auth_permission auth_user auth_user_groups auth_user_user_permission

Issues with django-storages and gunicorn processes

2015-10-21 Thread Mike Herring
I am using django-storages to store media files in Amazon S3. Gunicorn spaws three worker processes, each running their own copy of S3BotoStorage. When I go into filebrowser and upload a file, the current worker process adds it to its entries list, and therefore knows that the file exists. When

Re: ValueError: save() prohibited to prevent data loss due to unsaved related object

2015-10-20 Thread Mike Dewhirst
done this in the first place rather than launch into print. Sorry for bothering you and ... Thanks Mike On Tuesday, October 20, 2015 at 2:42:57 AM UTC-4, Mike Dewhirst wrote: On 18/10/2015 5:18 PM, Mike Dewhirst wrote: > On 18/10/2015 6:28 AM, Tim Graham wrote: >> Do

Re: ValueError: save() prohibited to prevent data loss due to unsaved related object

2015-10-19 Thread Mike Dewhirst
On 18/10/2015 5:18 PM, Mike Dewhirst wrote: On 18/10/2015 6:28 AM, Tim Graham wrote: Do you have code that worked before (didn't result in data loss) but doesn't work now? If so, it could be a bug in Django. Yes indeed. It is all in my repo. I'll go back to 1.7.x and reru

Re: Lack of View permission in Django

2015-10-18 Thread Mike Dewhirst
On 19/10/2015 5:03 AM, Ankit Agrawal wrote: I have an active Django project where the admin panel is used by the customer support team. I have two questions - 1. Django lacks a `view` permission because of which I have to assign the change permission to the customer support team which is slightl

Re: ValueError: save() prohibited to prevent data loss due to unsaved related object

2015-10-17 Thread Mike Dewhirst
On 18/10/2015 6:28 AM, Tim Graham wrote: Do you have code that worked before (didn't result in data loss) but doesn't work now? If so, it could be a bug in Django. Yes indeed. It is all in my repo. I'll go back to 1.7.x and rerun the tests and report back. Thanks Mike On

ValueError: save() prohibited to prevent data loss due to unsaved related object

2015-10-16 Thread Mike Dewhirst
x to 1.8.5 and this error seems like a show-stopper at the moment. 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

Re: Creating the testing db fails (django 1.8.5)

2015-10-14 Thread Mike Dewhirst
x27;ve tested createdb, dropping, creating and changing tables in the test db manually):Â http://pastebin.com/XDRiqaqL A quick glance at pastebin indicates the error is a failure to delete the test database. Can you manually delete it prior to running the tests? That would skip the entire

ManyToMany doesn't support validators?

2015-10-13 Thread Mike Herring
Doc here: https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ManyToManyField ManyToManyField does not support validators. Is there a particular reason that ManyToManyField doesn't support validators? I would like to add a validator to require the user to select at least

Re: Using Django and R in a production environment?

2015-10-07 Thread Mike Covington
Not sure if this approach is useful for you, but the following is how we use R and Django together. We use R to build Shiny apps. These are served on their default port 3838 (which users never actually go to directly). I've made a Django app to manage the Shiny apps and simply place them in an

Re: Corrupted Migration?

2015-10-02 Thread Mike Dewhirst
vance the database state to match the model state. 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: Corrupted Migration?

2015-09-30 Thread Mike Dewhirst
odel state somehow is de-synced from the database/migration state. I hop into the Django shell and check the model metadata. The fields exactly match state Y. My database is still in state X. Does that make sense? On Wednesday, September 30, 2015 at 4:10:18 PM UTC-7, Mike Dewhirst wrote:

Re: Corrupted Migration?

2015-09-30 Thread Mike Dewhirst
odel and bring the database back into alignment. This is all much the same as I said last time so if this doesn't work it means I haven't understood your problem. On Wednesday, September 30, 2015 at 5:08:22 AM UTC-7, Mike Dewhirst wrote: On 30/09/2015 4:16 PM, Daniel

Re: Corrupted Migration?

2015-09-30 Thread Mike Dewhirst
l not the database. Mike Thanks! -- 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 <mailto:dja

Re: Sending mail using smtp server

2015-09-28 Thread Mike Dewhirst
Rajat In your settings.py file you need to tell Django about your mail server like this ... EMAIL_HOST = EMAIL_PORT = EMAIL_HOST_USER = EMAIL_HOST_PASSWORD = https://docs.djangoproject.com/en/1.7/topics/email/ On 29/09/2015 5:07 AM, Rajat Singh wrote: I want to know the how to send mail u

[Off list] NOOB exposes CSRF token. Now what?

2015-09-25 Thread Mike Dewhirst
[2], 'PORT': dbhost[3], } } This is off-list because it isn't widely used. I don't wish to pollute the wider nob community with such heresy. It works nicely for me but best-practice (I'm told) is to store such things in environment vars and get them from t

Re: Prefetch() with through models

2015-09-16 Thread Mike Dewhirst
metable creation given enrolments, student preferences, curriculum/course requirements, availability of teachers and location of campuses. One of the main issues (ISTR) was memory - or lack of it. Someone other than me is going to have to help on this but I am interested in the solution. Good l

Re: access django admin got error 500

2015-09-11 Thread Mike Dewhirst
On 11/09/2015 3:59 AM, erik freaks wrote: Hi, I'm new in django, I had create simple website using django and deploy it to apache server, but when I try to access admin page I got error 500.. Try setting DEBUG = True so Django can report the actual error for you. Doing this is normal in develo

Re: Django oscar core apps confilicts with my local apps

2015-08-27 Thread Mike Dingjan
You can override the oscar analytics app by forking it: https://django-oscar.readthedocs.org/en/releases-1.1/topics/fork_app.html and then change it the way you want. You should pass a list with overridden apps to the get_core_apps function: INSTALLED_APPS = [ 'all.apps.except.analytics', ]

Re: Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-12 Thread Mike Dewhirst
On 13/08/2015 7:20 AM, Bernd Wechner wrote: Mike, Thanks. This was just a quick hack ripped off from ModelForm (although not as quick as I'd have liked as reverse engineering never is and had to read through ModelForm and get my head around bits) In any case wouldn't be ready for

Re: Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-12 Thread Mike Dewhirst
n the past but I always encounter difficulties when the next release of Django comes. Could you please get the core developers to adopt your code so I can use it? Thanks Mike I did as I threatened to and derived a class as follows: | fromdjango.utils importsix fromdjango.utils.

Re: display readonly or not

2015-08-11 Thread Mike Dewhirst
On 11/08/2015 7:17 PM, Daniel Roseman wrote: On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote: Â There is a get_read_only() method in the admin.ModelAdmin class. It normally returns self.readonly_fields but you can give it a callable. https://docs.djangoproject.com

Re: display readonly or not

2015-08-10 Thread Mike Dewhirst
obj=None): if obj is None or request.user.is_superuser: return self.readonly_fields else: return self.model._meta.get_all_field_names() ... then get_readonly_fields = ro_fields should make it happen like your pseudocode. Mike how can i set readonly for users staff? but

Re: How access verbose_name of a field in template?

2015-08-10 Thread Mike Dewhirst
obj.birth_date_verbose obj.birth_date The idea is to keep your templates simple and do anything less simple in python code in the view. There are two reasons being 1) it is faster and 2) non-programmers can tweak templates without bothering you. Cheers Mike I have an object: | p =Person.objects.get(pk

Re: Best Way to Organize Project With Overlapping Functionality

2015-08-09 Thread Mike Dewhirst
ither of these apps is intended to be pluggable -- they're > highly customized for a very specific business case. > Eventually you want a library you can call from each app. I would start with that in mind and write two apps exactly as they should be then refactor commonly used functionality

Re: Accessing a field's verbose_name

2015-08-04 Thread Mike Dewhirst
On 5/08/2015 12:53 AM, Déborah Leder wrote: Thanks for your answer, Mike. However, I have just tried it and it doesn't seem to work for me either... Your code : | self.__class__()._meta.get_field('{0}'.format(field_name)).verbose_name | gives the exact same result as | self.

Re: Accessing a field's verbose_name

2015-08-04 Thread Mike Dewhirst
;""New _meta API with Django 1.8""" return obj.__class__()._meta.get_field('{0}'.format(field)).verbose_name So then you can call get_verbose_name with the instance of whatever object you want plus the actual field name to get the verbose_name declar

Re: How To Activate Django Server.

2015-06-27 Thread Mike Dewhirst
sers\SteveB\envs You can always create a shortcut to ..\envs\myenv and leave it on your Desktop. Mike On Fri, Jun 26, 2015 at 5:49 PM, Javier Guerra Giraldez mailto:jav...@guerrag.com>> wrote: On Fri, Jun 26, 2015 at 4:56 PM, Steve Burrus mailto:steveburru...@gmail.com>>

Re: new installations tryout problem

2015-06-26 Thread Mike Dewhirst
gt; Out [12]: q Now q.poll = p q.save() ... and that should stop the IntegrityError: (1048, "Column 'poll_id' cannot be null") With any luck. hth Mike elim@aLnx:mydjango$ python manage.py shell Python 2.7.6 (default, Mar 22 2014, 22:59:56) Type "copyright

Re: Atomic block termination question

2015-06-25 Thread Mike Dewhirst
Carl Thank you very much. Great overview. Confidence boosting. Mike On 26/06/2015 2:57 AM, Carl Meyer wrote: Hi Mike, On 06/25/2015 01:53 AM, Mike Dewhirst wrote: On 25/06/2015 2:34 AM, Carl Meyer wrote: On 06/24/2015 02:16 AM, Mike Dewhirst wrote: On 24/06/2015 4:43 PM, Mike Dewhirst

Re: Atomic block termination question

2015-06-25 Thread Mike Dewhirst
Carl On 25/06/2015 2:34 AM, Carl Meyer wrote: Hi Mike, On 06/24/2015 02:16 AM, Mike Dewhirst wrote: On 24/06/2015 4:43 PM, Mike Dewhirst wrote: When saving a model I'm getting a TransactionManagementError - You can't execute queries until the end of the 'atomic' block

Re: Atomic block termination question

2015-06-24 Thread Mike Dewhirst
On 24/06/2015 4:43 PM, Mike Dewhirst wrote: When saving a model I'm getting a TransactionManagementError - You can't execute queries until the end of the 'atomic' block Ticket #21540 seems fairly explicit at least where Postgres is concerned. TransactionManagementError pre

Atomic block termination question

2015-06-23 Thread Mike Dewhirst
uclear expert. How do I terminate the save() method code in that atomic block and then immediately execute my queries? I need the save() to complete so I can get_or_create some 1:1 records belonging to the model being saved. Thanks Mike -- You received this message because you are subscr

Re: ModelAdmin.save_as integrity error

2015-06-23 Thread Mike Dewhirst
the Admin didn't know that and replicated existing related objects. It was getting somewhat out of hand. My solution FWIW is to use try/except around my own related object creation and pass if already there. For the moment that seems to be working. Cheers Mike El martes, 23 de jun

[Partly solved] ModelAdmin.save_as integrity error

2015-06-22 Thread Mike Dewhirst
I commented out the save() method in the Substance model (the master model with a number of 1:1 and 1:n relationships) and it started saving as new successfully. Unfortunately I do a lot of stuff in that save() method so I have to figure out how to do that another way. Mike On 23/06/2015 12

ModelAdmin.save_as integrity error

2015-06-22 Thread Mike Dewhirst
es unique constraint "substance_liquid_substance_id_key" DETAIL: Key (substance_id)=(54) already exists. Exception Location: C:\Users\mike\env\xxex3\lib\site-packages\django\db\backends\utils.py in execute, line 65 Python Executable: C:\Users\mike\env\xxex3\Scripts\python.exe Python Vers

Re: Inconsistency when importing views and models

2015-06-19 Thread Mike Dewhirst
mport? How does it work from within Python running in a terminal? If things work inconsistently it probably means you are successfully importing something which is on sys.path which you didn't expect. hth Mike To import views in urls.py I have to use | fromimportviews | ...while in

Re: Ready to throw the keyboard using Django 1.7 on Windows 7

2015-06-19 Thread Mike Dewhirst
On 20/06/2015 2:16 AM, Todd Kovalsky wrote: Having a miserable time trying to get a django site running on a wintel box. The issue comes after I add models to models.py. I keep getting the error Could not import settings 'myapp.settings'...No module named myapp.settings. Your DJANGO_SETTINGS_

Re: heavy refactoring

2015-06-11 Thread Mike Dewhirst
On 11/06/2015 6:02 PM, Andre Avorio wrote: Hi Mike, I had the exact same problem and after investigating I ended up creating a new app from scratch and porting the code and data across. I don't remember finding any specific documentation on this on Django's website. Did I miss som

Re: Simulating REMOTE_USER login with the test server

2015-06-09 Thread Mike Dewhirst
reloading after saving code changes but you can restart Apache easily enough to live with a little inconvenience during development of that part of your project. Mike Best, Gergely -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: heavy refactoring

2015-06-09 Thread Mike Dewhirst
On 9/06/2015 6:43 PM, Erik Cederstrand wrote: Den 09/06/2015 kl. 10.09 skrev Mike Dewhirst : Does anyone have any experience with app-renames and maybe some refactoring advice for me? Maybe I don't even need to replace and destroy ... If you wanted, you could set Meta.db_table fo

heavy refactoring

2015-06-09 Thread Mike Dewhirst
ed to replace and destroy ... 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 gr

Re: how to get get-pip.py

2015-06-03 Thread Mike Dewhirst
g Python 3.4 and you are able to get a non-Supervisor command prompt running, then install Django like this: C:\users\steve\pip install django 6. If you encounter any problems at all you must let Microsoft know because they will want to fix it. Mike On 4/06/2015 11:16 AM, Steve Burrus wrot

Re: how to get get-pip.py

2015-06-03 Thread Mike Dewhirst
>= 3.4 because it has pip built in. Good luck Mike On Wed, Jun 3, 2015 at 11:13 AM, Steve Burrus mailto:steveburru...@gmail.com>> wrote: well I am ab;e to install pip okay BUT there must be a config. error because all that I get when I t ry to run pip is this : "C

Re: Trouble w. Setting Up Virtual Env.

2015-06-02 Thread Mike Dewhirst
experts. I use it but I installed it some time ago and it just works for me. It will be well worth your time and effort to keep trying. Good luck Mike On 3/06/2015 3:19 AM, Steve Burrus wrote: */I hasve repeatedly tried now to set up the Django Virtual Environment without any success! Just what

Re: Where to now??

2015-06-01 Thread Mike Dewhirst
ere. I've been using virtualenv on Windows for a while and use little batch files to manage things. That suits me but you might find virtualenvwrapper more to your liking. I'm sure you'll enjoy Django Good luck Mike * * * * * * -- You received this message because you are subs

Re: need to upgrade django1.4.5-->django1.5, but apt-get install django tells me i'm running latest version

2015-06-01 Thread Mike Dewhirst
On 2/06/2015 3:17 AM, arthur sherman wrote: i get the following errors in the apache2 error.log: VersionConflict: (Django 1.4.5 (/usr/lib/python2.7/dist-packages), Requirement.parse('Django>=1.5')) but when i attempt upgradinging django apt-get install reports that i'm at the latest version:

Re: icontains case-sensitive on MySQL

2015-05-31 Thread Mike Dewhirst
On 1/06/2015 5:57 AM, Jake Gordon wrote: There needs to at least be a warning in the documentation. https://docs.djangoproject.com/en/1.8/ref/databases/#collation-settings I spent a lot of time debugging only to find this was a problem with Django. On Thursday, October 16, 2008 at 6:56:07 P

Re: committing after fixture load or running tests without transactions

2015-05-12 Thread Mike Dewhirst
On 13/05/2015 5:07 AM, Larry Martell wrote: I have a situation where I need to run an external python script in a test after the tables are loaded from fixtures. This doesn't work because django runs the tests in a transaction and the external python script is running in its own MySQL connection

Re: percentage or number data entry solution please

2015-05-11 Thread Mike Dewhirst
n enhancement along the lines of a DecimalField arg/kwarg which lets the form accept a % sign but throws it away. I have added some help text which explains what to do. Thanks Derek Mike On Monday, 11 May 2015 02:45:00 UTC+2, Mike Dewhirst wrote: In the Admin I want the user to be abl

percentage or number data entry solution please

2015-05-10 Thread Mike Dewhirst
ango docs on MultiValueField because if that is the answer I'm trying to fix the wrong problem. I just want to ignore the percent sign if the user sticks it into a DecimalField. Thanks for any ideas Mike -- You received this message because you are subscribed to the Google Groups "D

Re: Deploying django

2015-05-04 Thread Mike Dewhirst
On 4/05/2015 6:43 PM, João Marques wrote: Oh I get it. I have a few questions: 1. Wheres should I configure my nginx? /etc/nginx (probably) This is part of my nginx config ... location /static/ { root/home/mike/envs/myproject/static; access_log off

Re: How to represent a calendar month as a field in django models

2015-05-03 Thread Mike Dewhirst
and Murphy's law says it will happen after you have thrown data away. Anyway, your choices are to calculate it every time you need it or do it once and use it thereafter. The right choice will depend on the requirements. Which will change. Cheers Mike -- You received this message be

Re: How to represent a calendar month as a field in django models

2015-05-03 Thread Mike Dewhirst
On 4/05/2015 11:41 AM, Tom Lockhart wrote: On May 3, 2015, at 2:35 PM, Matthys wrote: I posted the question also on stackoverflow: http://stackoverflow.com/questions/30017229/how-to-represent-month-as-field-on-django-model The question is for situations where a model instance relates to a sp

Re: Deploying django

2015-05-03 Thread Mike Dewhirst
y put the static files) hth 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, sen

Re: Turn off migrations completely in Django 1.7

2015-04-27 Thread Mike Dewhirst
fying a thread semi-hijack. Anyway, I suspect disabling migration - even if a "master-switch" could be built - is undesirable if one is using any of the django tables. Please forgive me for hijacking this thread to discuss top-posting. Mike On 28/04/2015 1:27 PM, Jamie Lawrence wrote

Re: Turn off migrations completely in Django 1.7

2015-04-27 Thread Mike Dewhirst
ld it suffice to have all your models specify "managed = False" in the Meta class? https://docs.djangoproject.com/en/1.7/ref/models/options/#managed Mike I want to disable everything related to migrations. We're using better migration solution, which is project-wide and relat

Re: Migrations During Development

2015-04-25 Thread Mike Dewhirst
still learning about migrations but I can't see anything wrong with answering yes to your question. mike -- Timothy Cook LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook MLHIMÂ http://www.mlhim.org <http://www.mlhim.org/> -- Y

Re: django 1.8.1 : A server error occurred. Please contact the administrator.

2015-04-24 Thread Mike Dewhirst
from myproject.polls import something" What makes this work is the existence of a (probably empty) file called __init__.py in each directory on either side of the path separator (unix/linux/mac slash or windows backslash) so you might also check you have those __init__.py files in place

Re: Trying understand static files.

2015-04-22 Thread Mike Dewhirst
above? I read that I can add a 'location' in the nginx config file but don't understand how nginx would understand to provide it when my template is called. You probably want three locations ... here are mine: location /static/ { root/home/mike/

Re: Diplay database column headers on HTML programmatically

2015-04-11 Thread Mike Dewhirst
On 12/04/2015 3:38 PM, Kishan Mehta wrote: Hey Friends, There is a model.py and i want to add its column headers in drop down list in HTML. Any way to pass them through views.py ? Dont want to hardcode at HTML because too many columns . You probably want https://docs.djangoproject.com/en/1.8/

Re: Question on Extending the existing User model documentation

2015-04-11 Thread Mike Dewhirst
the record on saving. Remember, the Admin is an app and not part of core Django. The docs you quote are about core Django. If you are not using the Admin you might need to use the post_save signal for the user model to create the profile model. Mike -- You received this message becau

Re: KeyError: 'default'

2015-04-07 Thread Mike Dewhirst
#x27;m more or less committed to using fixtures for testing. Mike Also, I see you're using sqlite3 for development, although this is very fast, it may have considerable differences from using Postgres. So I think it's a good idea to run your tests on postgres (at least on the CI).

Re: KeyError: 'default'

2015-04-06 Thread Mike Dewhirst
On 7/04/2015 1:07 AM, Pavel Kuchin wrote: Hi Mike, I think the issue is that Django can't find your default DB settings. Please take a look: https://docs.djangoproject.com/en/1.8/ref/settings/#databases Pavel Thanks for responding. I have had that setting running since they were

KeyError: 'default'

2015-04-06 Thread Mike Dewhirst
Can someone please explain what KeyError: 'default' means? This is the first time I have tried Django 1.7 and without doing any migrations all I have done here is this ... (xxex3) C:\Users\mike\env\xxex3\ssds>copy substance\fixtures\test_data.json substance\fixtures\init

What happens if pk value gets too big?

2015-04-03 Thread Mike
Hi, Is there risk of getting too big PK value while adding and deleting rows for long time in same table? -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, sen

Re: Using Unicode in django

2015-04-02 Thread Mike Dewhirst
#x27;s identification. You seem to have a good handle on that so I suspect I haven't understood your question. Mike Pls i would appreciate anyone's assistance. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Saving Contionus Data through Django

2015-04-02 Thread Mike Dewhirst
will show you how to establish foreign key relationships between models. I think Django is fantastic and I hope you enjoy. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: login error: hostname doesn't match .... but it does!!!

2015-03-31 Thread Mike Dewhirst
railing dot. I would put in the full hostname to prove it works then sequentially remove bits until the problem is revealed. ALLOWED_HOSTS = [ 'www.jtprince.dev.doba.com', '.jtprince.dev.doba.com', '.dev.doba.com', '.doba.com', ] Just a

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
I am moved to say thank you to all the devs from day 1 for Django. It is a marvellous piece of work. All of it. Thanks Mike On 30/03/2015 6:53 PM, Mike Dewhirst wrote: On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: snip That said, maybe I'm not getting your workflow correctly, but to me it seems that if request.user is not owner, some fields shou

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: On 29/03/2015 7:28 PM, Julo wrote: Maybe you can add an interface for the models that are importants and hook to the save/delete signal a interfaced function called CanSave() And you check the

Re: sidebar menu appears with every click on the main menu item before it disappears

2015-03-29 Thread Mike Dewhirst
Using the Django developer's webserver, you can insert print statements wherever you like in the code and see the results. It also identifies syntax errors immediately and displays error tracebacks. Enjoy Mike All the other templates are including the base.html, see below

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 2:06 AM, Ezequiel wrote: On Sunday, March 29, 2015 at 5:08:06 AM UTC-3, Mike Dewhirst wrote: A perhaps better solution would be to disable the Save and Delete widgets/actions in particular circumstances. How can I do something like this? The quick&dirty way I

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
post using a different method. You are correct. That was a bad idea! Thanks Mike duminică, 29 martie 2015, 11:08:06 UTC+3, Mike Dewhirst a scris: At the moment "has_change_permission" in the Admin works by returning 403 Forbidden if it gets a False. That doesn't

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 7:09 PM, Avraham Serour wrote: maybe overwrite the view in your own modeladmin class? I need to keep using the Admin and haven't done anything like that previously. I'll have to do the research. Thanks Mike On Sun, Mar 29, 2015 at 11:07 AM, Mike Dewhirst

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
7;ll dig a bit deper. It would be best to do it in the model but I'm not sure how I can get request.user from there. Thank you Mike Sorry for the bad english. Saludos, Julian -Original Message- From: Mike Dewhirst Sender: django-users@googlegroups.com Date: Sun, 29 Mar 2015 19:07:1

How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
. The substance has a status field which can be made "public domain". The business rule is that a user can see and edit all their own substances but can see nothing owned by anyone else - unless they have been put in the public domain (and which then must be readonly to the "public

Re: ProgrammingError: relation "django_content_type" already exists

2015-03-24 Thread Mike Dewhirst
ot;No changes detected" so I suppose the Django ones were done when I first ran manage.py migrate. That's only a guess. I'll keep reading the docs. Thanks in advance Mike * see below On 24/03/2015 5:00 PM, Mike Dewhirst wrote: This is my first stab at upgrading directly f

ProgrammingError: relation "django_content_type" already exists

2015-03-23 Thread Mike Dewhirst
See below. Not sure where to go from here. Any ideas? Thanks Mike On running manage.py migrate it returns a ProgrammingError as follows: (xxex3) C:\Users\mike\env\xxex3\ssds>python manage.py migrate Operations to perform: Synchronize unmigrated apps: admindocs, messages, credit, refer,

Re: Why is appearance of admin page so different between development and deployment servers?

2015-03-22 Thread Mike Dewhirst
On 23/03/2015 9:54 AM, talex wrote: On second thought maybe using /python3.3/site-packages/django/contrib/admin/static/admin directly is not the best practice. I tried using collectstatic, but then the admin could not find it. Please comment. Here is a collectstatic incantation which works fo

Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?

2015-03-19 Thread Mike Dewhirst
On 20/03/2015 12:19 PM, Fellipe Henrique wrote: Here is a fairly typical static file template line ... href="{{STATIC_URL}}css/styles.css" media="screen"/> ... and to see where that fits, insert something like this in your local settings. You will discover any bludners fairly quickly ... pr

Re: Django 1.6's lifespan for security updates?

2015-03-18 Thread Mike Dewhirst
be. Just a random thought. Mike On 19/03/2015 1:38 PM, Christian Hammond wrote: Hey Tim, I can definitely relate. It's not fun maintaining security releases (or fixes of any sort) for older versions of the software. Been there (am there now). We're trying to encourage people to mov

Re: Fixing a poorly written Django website (no unit tests)

2015-03-04 Thread Mike Dewhirst
On 4/03/2015 11:01 PM, Some Developer wrote: Hi, I've been working on a Django website for about 2 months on and off and am nearing the end of development work where I can start thinking about making it look pretty and the after that deploy to production. I've been doing lots of manual testing

Free Django Video Tutorials

2015-03-01 Thread Mike Hibbert
Hi All Just a quick shout out to all you guys learning Django! I have a 11+ hrs FREE tutorial series to get you started here: https://mikesdjangotutorials.co.uk Check it out, there stuff there for beginners and advanced! Mike -- You received this message because you are subscribed to the

Did you try NamedUrlWizardView ? I tried example code but does not work ;-(

2015-02-27 Thread Mike
File ... ... site-packages\django\views}generic\base.py line 60 "attributes of the class." % <(cld.__nsmr__,key) TypeError: ApplyWizard() received an invalid keyword 'url_name'. as_view only accepts arguments that are already attributes of the class. If somebody got NamedUrlWizardView working, l

Re: TypeError: __str__ returned non-string (type bytes)

2015-02-25 Thread Mike Dewhirst
implementing @python_2_unicode_compatible Thank you again Mike On Wednesday, February 25, 2015 at 9:08:45 PM UTC+11, Erik Cederstrand wrote: > > > > Den 25/02/2015 kl. 05.33 skrev Mike Dewhirst >: > > > > ==

How to save user to foreignKey field for new records in modelFormset case?

2015-02-25 Thread Mike
Hi, I have created modelFormset using SchoolHistory model and SchoolForm form. "SchoolFormSet = modelformset_factory(SchoolHistory, form=SchoolForm)" I get other content from Form, but should save current user to SchoolHistory model too. user=models.ForeignKey(User) school_name = mode

TypeError: __str__ returned non-string (type bytes)

2015-02-24 Thread Mike Dewhirst
This is driving me insane so any hints will be greatly appreciated ... Thanks Mike Here is the entire unedited test sequence plus failing code ... Python: 3.4 Django: 1.6.9 SQLite3: memory Creating test database for alias 'default

Re: How to handle model constants

2015-02-23 Thread Mike Dewhirst
them alphabetically so I can find them easily enough scrolling quickly through the file. At the top of my modules I say ... from import CONST1, CONST2 etc Works for me Mike But I wanted to put the constants in a separate class on their own. This is what I hav so far: models.py class TaskS

<    5   6   7   8   9   10   11   12   13   14   >