Re: How to access gmail

2023-08-27 Thread Carl Karsten
users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/2e0feaab-2b9d-4901-9546-299a81e5ac3e%40stacktr

google auth and context

2023-05-18 Thread Carl Karsten
; like it starts on https://veyepar.nextdayvideo.com/main/show_parameters/441/ 441 is the client.id - which would be handy to know when I get a token back. Carl Karsten -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

goog auth and context

2023-05-18 Thread Carl Karsten
it starts on https://veyepar.nextdayvideo.com/main/show_parameters/441/ 441 is the client.id - which would be handy to know when I get a token back. So I know what client this token is for. Carl Karsten -- You received this message because you are subscribed to the Google Groups "Django

Python Client generated from swagger

2019-03-28 Thread carl collins
it to do request to my API. Even tried googling but found nothing relevant online on how to use the client generated to consume my API. Please someone help! Kind Regards Carl Collins -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: Performing SQL queries on SQLite database

2019-03-25 Thread carl collins
Hello, Please I need advice on how I can go on with this. Thanks On Sat, Mar 23, 2019 at 8:26 PM carl collins wrote: > Hello guys, > I'm Carl Collins from Cameroon. I'm working on this Django Project and I > got stuck . Need help.The first thing I would love to ask is about > pe

Performing SQL queries on SQLite database

2019-03-23 Thread carl collins
Hello guys, I'm Carl Collins from Cameroon. I'm working on this Django Project and I got stuck . Need help.The first thing I would love to ask is about performing SQL queries in Django use Django ORM. Presume I have something like this: connection = sqlite.connect('data.db') cursor

Re: Hello From Nigeria

2019-03-21 Thread carl collins
Pls add me +237677104421 On Thu, Mar 21, 2019, 13:11 Gabriel Stone wrote: > hello i am from Ghana am i qualified to join? > > On Thu, Mar 21, 2019 at 1:54 PM Asiwaju Lasisi Prodigy Olatunbosun < > bosun...@gmail.com> wrote: > >> Yes 08024273381 >> >> On Wednesday, 13 March 2019 12:44:16 UTC+1,

Re: Django ignoring Create_DB setting on test

2019-02-18 Thread Carl Marshall
I'll note that "CREATE_DB" is slightly misleading, and would be more accurately called "CREATE_SEPARATE_TEST_DB_IN_ORACLE". The error I'm getting is somewhat misleading also as there's nothing wrong with the ALWAYS keyword, the problem is that the test script is trying to create a table in a

Django ignoring Create_DB setting on test

2019-02-18 Thread Carl Marshall
migrations/ in the stack trace for this fault, and for this secondary database? Thanks Carl *Footnotes* 1. Most of this new/duplicated db backend is identical to the Django 2.1.7 package, with the following changes: *base.py* 74: vendor = 'cerner_oracle' 75: display_name = 'Cerner O

Re: beginner guide

2018-10-08 Thread carl collins
Follow this awesome tutorial> https://docs.djangoproject.com/en/2.1/intro/tutorial01/ On Mon, Oct 8, 2018 at 5:39 PM Ashok Reddy wrote: > hello every one .i am beginner to Django. Could you please suggest me the > best source to learn,i am very enthusiastic to learn. > > -- > You received this

Re: Implementing a django cart using Django cart module Error: unhashable type dict

2018-09-04 Thread carl collins
Thanks Gopal On Tue, Sep 4, 2018 at 4:12 PM wrote: > Dear Carl, >> > > I'm sorry, I've no idea what the Cart is. I'm assuming that it is a > class which can be instantiated with some dictionary data. > So you try passing request.data instead of just request to the C

Trying to build a cart using django cart. "" error unhashable type dict ""

2018-09-04 Thread carl collins
Here is the code for view.py in my cart app please help(also see the screenshot): from django.template import loader from django.http import HttpResponse from django.template.loader import render_to_string import django.template.loader from cart.cart import Cart from .models import Product

Implementing a django cart using Django cart module Error: unhashable type dict

2018-09-04 Thread carl collins
from django.template import loader from django.http import HttpResponse from django.template.loader import render_to_string import django.template.loader # Create your views here. # Create your views here. from cart.cart import Cart from .models import Product '''from cart.models import

django 2 ajax search example

2018-03-24 Thread Carl Brubaker
I am having much trouble getting an AJAX search to work. I am working with django 2, and all the examples and tutorials I can find are django 1.x. The code that I have that almost worked once(I think - it put the request through but never displayed results) has been greatly butchered as I've

Re: Phone Number Validation

2018-03-16 Thread Carl Brubaker
Guilty as charged! Now that you mention "not", I remember seeing that in a tutorial. As for doing it again, I hate my job and don't have time or resources to quit and go to school, so I'm trying to learn on the fly. I hope to write a program to do my current job, because, so far, the ones I've

Phone Number Validation

2018-03-15 Thread Carl Brubaker
I'm trying to make my own phone number form, and I'm having trouble with number validation. Since international numbers can use "(40) (30)" I want to check that only numbers were entered. I can't seem to make it work though. def clean_international(self): data =

Re: tutorial 2.0 - 1: problem

2018-03-15 Thread Carl Brubaker
We could use some code from your myapp/urls.py and your myapp/polls/urls.py files. Without it, we don't know what is wrong. On Thursday, 15 March 2018 20:03:57 UTC-4, Denny Terreno wrote: > > Hello, > I'm new to django, and I'm trying to learn it, but I'm stuck on the 1st > part of the

Re: Webpage Displays Blank

2018-03-13 Thread Carl Brubaker
Added urls file On Tuesday, 13 March 2018 10:40:29 UTC-4, Derek wrote: > > Maybe you need to show what your urls.py looks like as well? > > On Tuesday, 13 March 2018 05:57:55 UTC+2, Carl Brubaker wrote: >> >> I'm probably missing something simple, but I can't get my inf

Webpage Displays Blank

2018-03-12 Thread Carl Brubaker
I'm probably missing something simple, but I can't get my info to display from my database. I have 2 abstract models to make 1 normal model. My url views aren't giving me errors, the web browser finds them. My variables aren't correct(I can only assume). Thanks! -- You received this message

Laying out a form like "fieldsets" and "TabularInline" on a non-"admin" page

2018-02-15 Thread Carl Brubaker
I've been trying to make a form that will get customer information: First Name Last NameMI (etc) and have been running into issues I can't seem to resolve without doing it the hard way. I was just wondering if there was an easier method? Using generic views and edit views, the

Re: Template Namespace Error (django2)

2018-01-30 Thread Carl Brubaker
So I'm not exactly sure what happened. I made a second "locallibrary" program that worked and then compared all of my files, because after I tried to change my original one back to the way Mozilla lays it out, it still wouldn't work. When I repasted the catalog/views.py file contents, it

Template Namespace Error (django2)

2018-01-29 Thread Carl Brubaker
I'm going through the Mozilla Django tutorial and I can't get the template namespacing to work. If I leave the templates in the "templates" folder, all is well. When I try to move them to the "templates/catalog" folder it's nothing but errors. I think it might have something to with the

Re: django 2 - How do I make search box?

2018-01-25 Thread Carl Brubaker
I did go through the tutorial. I'm reading through the the forms section of the documentation now. I'm more of a visual learner, so sometimes I have to read things 10 times til it makes sense. Thanks for your help! -- You received this message because you are subscribed to the Google Groups

django 2 - How do I make search box?

2018-01-23 Thread Carl Brubaker
I am trying to make a search field in a template and connect it back to my database so I can "find" stuff. I found this in the django docs: >>> Author.objects.filter(name__unaccent__icontains='Helen')[>> Mirren>, , ] which is helpful, but I'm having trouble connecting to my template: I'm

Re: django admin code modification

2017-12-24 Thread Carl Brubaker
I am trying to make a customer database (name, address, etc) and I need to be able to add new customers, edit customer info, delete customers, and search for them through name and phone number (and possibly more). When I enter the admin site and select my app, I have all of those fields given

django admin code modification

2017-12-23 Thread Carl Brubaker
So there are lots of things I like about the django admin, and somethings I would like to change. Since django is kinda about not reinventing the wheel, is there an "app" or file or something where I can find the admin information to modify it to what I want, and then save it as a new app?

Re: Django 2.0 Tutorial Template

2017-12-10 Thread Carl Brubaker
Alright, so I found out the my text editor was saving my files incorrectly. Even though it had ".html" it was displaying the whole text in the web browser, instead of interpreting the the code. -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Django 2.0 Tutorial Template

2017-12-10 Thread Carl Brubaker
Tried that one too, as it is further down in the tutorial. Still the same result. On Sunday, 10 December 2017 17:52:30 UTC-5, Roberth Solis Martínez wrote: > > I think its better if you use: > > context = { > 'latest_question_list': latest_question_list, > } > > return render(request,

Re: Django 2.0 Tutorial Template

2017-12-10 Thread Carl Brubaker
Code for my view.py from django.shortcuts import render from django.http import HttpResponse from django.http import Http404 from django.shortcuts import render from django.template import loader from .models import Question # Create your views here. def index(request): latest_question_list

Re: Django 2.0 Tutorial Template

2017-12-09 Thread Carl Brubaker
I copied it from the django tutorial page: {% if latest_question_list %} {% for question in latest_question_list %} {{ question.question_text }} {% endfor %} {% else %} No polls are available. {% endif %} -- You received this message because you are subscribed to

Django 2.0 Tutorial Template

2017-12-09 Thread Carl Brubaker
I'm not sure what is wrong, but my template doesn't load correctly. Instead of what I'm supposed to see I get this in my web browser: What yo? Help please! -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Django 2.0 tutorial

2017-11-24 Thread Carl Brubaker
I figured it out. I had a space in between the "path(' '," single quotes in the polls.urls and there isn't supposed to be one. Thanks for all of your help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Django 2.0 tutorial

2017-11-23 Thread Carl Brubaker
Ok, I applied the migration, but it still doesn't work. Maybe this is a django 2.0 bug that needs worked out. I figured I'd learn 2.0 so I wouldn't have to relearn after 2.0 releases. The initial check before creating the "polls app" worked, but it can never find the address. Still need more

Re: Django 2.0 tutorial

2017-11-23 Thread Carl Brubaker
Correction - The "import include" was mentioned in the tutorial, I missed it. I still need help! On Thursday, 23 November 2017 09:33:35 UTC-5, Carl Brubaker wrote: > > I am brand new to Python and Django. I am trying to learn both > simultaneously. I wanted to run the Djan

Django 2.0 tutorial

2017-11-23 Thread Carl Brubaker
I am brand new to Python and Django. I am trying to learn both simultaneously. I wanted to run the Django tutorial to make sure it works on my computer, iMac running 10.13.1. I know I have coding issues, and managed to figure out some of the problems that I had, but the polls tutorial does

Re: Images are not displaying

2017-06-16 Thread Carl
Hi! Because static is a folder on the root of your website, try putting a slash in front of static; for example, Hope this helps. :-) Sincerely, Carl Original Message Subject: Images are not displaying Local Time: June 16, 2017 1:44 AM UTC Time: June 16, 2017 5:44 AM From

Re: trouble with setting static for img and css

2017-05-11 Thread Carl
WorkingDirectory=/home/z/pesweb ExecStart=/home/z/pesweb/web_env/bin/gunicorn --bind unix:/home/z/pesweb/pesweb.sock pesweb.wsgi:application [Install] WantedBy=multi-user.target Hope this helps! Cheers, Carl Original Message Subject: trouble with setting static for img and css

Re: send email with django

2017-04-19 Thread Carl
As a counter-perspective, we have this working with a paid G Suite (formerly Google Apps) account. *Important* We had to register the IP address of our server with G Suite. This Google support document outlines the process: SMTP relay: Route outgoing non-Gmail messages through Google

inspectDB and 'id' can only be used as a field name if the field also sets 'primary_key=True'.

2017-03-23 Thread Carl Brewer
in models.py? I'm not certain if ID is a suitable primary key or not - if the primary key is udid, or if it's a mashup of ID and udid, can I tell models.py about it and if so, how? Pointers to relevant documentation much appreciated! Thank you! Carl -- You received this message because you

Re: New-style middleware

2016-11-22 Thread Carl Meyer
request and response processing, and your case did not receive as much attention as it perhaps should have. I've considered a few possible approaches to fix this, and I think your suggestion of a built-in base class that implements the simplest-possible version of __init__ and __call__ makes sense; it is

Re: Testing a reusable app which uses a database

2016-10-03 Thread Carl Meyer
ossible to test it without setting up Django, no. But you don't need a full-fledged "project" for this, the bare minimum you need to do is import django from django.conf import settings settings.configure() # if you need any settings, pass as a dict django.setup() before

Re: An almost reusable app, how to make it reusable?

2016-10-03 Thread Carl Meyer
if the setting doesn't exist and in the exception message instruct the developer that they must set the setting. Carl -- 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, s

Re: Extracting the username:password from the host

2016-09-12 Thread Carl Meyer
TTP Basic Authentication; the values should end up in the Authorization header. Carl -- 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+uns

Re: Is a good practice to put app inside another?

2016-06-03 Thread Carl Meyer
ouping/hierarchy is a perfectly reasonable thing to do. Carl -- 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. T

Re: Possible bug with transaction.on_commit

2016-05-16 Thread Carl Meyer
the connection before it calls any of the hooks? Not entirely sure, need to add a failing test and play with it a bit. Thanks for catching and reporting this. If you'd be willing to file a ticket in Trac, that'd be great. Carl -- You received this message because you are subscribed to the Google

Re: Django formset hidden id field

2016-05-06 Thread Carl Meyer
Hi Rob, On 05/03/2016 12:13 PM, Rob Ladd wrote: > Carl Meyer said: > > "Whatever queryset you pass to the model formset limits the > available rows for editing. The end user can edit the PK to refer to any > item in that queryset, but not any item in the table. " &g

Re: Django formset security and injecting PKs in formset hidden id fields

2016-05-06 Thread Carl Meyer
user to edit only the objects they own. If you still believe you're seeing a security issue here, please email secur...@djangoproject.com with step by step reproduction instructions. Thanks, Carl -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Django project structure

2016-02-04 Thread Carl Meyer
fic to one Contest. That would be the more flexible approach. But I suppose if you are sure that you want "one contest each month" and that's it, no more flexibility is needed, you could just add date fields to some of the other models and then modify your queries to select only objects for the c

Re: Django project structure

2016-02-04 Thread Carl Meyer
I've never actually found a good use case for url namespaces, outside of contrib.admin.) Carl -- 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

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
d go for (a) or (b), depending on just how much I was using the ORM in the management command. I'm not convinced that a fourth (or third supported public) option is necessary here. If it's just a few queries, you use `using`, if it's more than that and you want a broader policy applied, you use a d

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
Hi Vinay, On 02/02/2016 10:56 AM, 'Vinay Sajip' via Django users wrote: > On Tuesday, February 2, 2016 at 5:08:40 PM UTC, Carl Meyer wrote: > > You can't (well, you might be able to by poking around in the internals > of the django.db.connections object, but I'd strongly ad

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
Hi Vinay, On 02/02/2016 09:52 AM, 'Vinay Sajip' via Django users wrote: > > On Tuesday, February 2, 2016 at 3:27:10 PM UTC, Carl Meyer wrote: > > Nothing in your code ever "overrides" settings.DATABASES['default']. > > > Dear Carl, > > Thanks fo

Re: Unintuitive behaviour of management commands with multiple databases

2016-02-02 Thread Carl Meyer
ng .using() explicitly to use a non-default database is burdensome (and the situation can't be handled automatically with a custom database router class), you could look at a third-party solution like django-dynamic-db-router [1], which provides an `in_database` context manager that does

Re: Django imports models for apps that aren't enabled?

2016-01-05 Thread Carl Meyer
guess would be that you're seeing case (b). If you just add an "assert False" at module-level in the models file in question, the resulting traceback should show you the import chain leading to its import. Carl -- You received this message because you are subscribed to the Google Groups

Re: List of available Jinja2 global symbols

2015-11-23 Thread Carl Meyer
yone > have an idea how to make messages work with jinja templates? The simplest solution for now may be to add context-processor support to the Jinja2 backend, which can be done without too much difficulty by subclassing it. Carl -- You received this message because you are subsc

Re: Reducing redundancy in tests, logged-in vs. not-logged-in

2015-11-16 Thread Carl Meyer
> user is anonymous (and thus the test should fail) or logged in with > appropriate rights (and thus the test should pass). > > For context, this is being run within Django-WebTest as recommended > to me by Carl Meyer in case it has features I haven't yet encountered > that would

Re: following 302s in WebTest form.submit() (was Best practices for writing functional tests to exercise forms?

2015-11-13 Thread Carl Meyer
Hi Tim, On 11/13/2015 10:06 AM, Tim Chase wrote: > On 2015-11-09 12:41, Tim Chase wrote: >> On 2015-11-06 01:09, Carl Meyer wrote: >>> [1] https://pypi.python.org/pypi/WebTest >>> [2] https://pypi.python.org/pypi/django-webtest >> >> Just to follow up, djan

Re: Best practices for writing functional tests to exercise forms?

2015-11-05 Thread Carl Meyer
mmatically "fill out" the form fields present in the markup and submit them. This allows for integration tests that will catch errors like forgetting to include a formset's management form in your template. I use WebTest rather than the Django test client for all my request/response integrat

Re: include template which extends something else

2015-10-28 Thread Carl Meyer
endblock %} > > and wallitem.html like that: > > > > {% block wall_item_header %} > {% endblock %} > > That template structure should work just fine. I just tested here with a similar set of templates and it worked. So there's something else going on. Ca

Re: include template which extends something else

2015-10-28 Thread Carl Meyer
`extends` in an included template -- I think that should work just fine for your use case (and I just tested to verify that it does work). Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: include template which extends something else

2015-10-28 Thread Carl Meyer
te and the including template have separate and unrelated inheritance and blocks. Carl -- 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: How to create a global management command?

2015-10-27 Thread Carl Meyer
command has no practical effect on its use (except when it comes to overriding management commands and the ordering of `INSTALLED_APPS`). Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

Re: duplicated selenium test fails

2015-10-21 Thread Carl Meyer
On 10/21/2015 02:55 AM, Ulrich Laube wrote: > Am 21.10.2015 um 00:18 schrieb Carl Meyer: >> On 10/19/2015 03:03 AM, Ulrich Laube wrote: >>> It boils down to this: >>> [...] >>> Is it a known problem? >> >> Not really a problem - you just need

Re: duplicated selenium test fails

2015-10-20 Thread Carl Meyer
found. Right, because in this test there is no Post with ID 1, just one with ID 2. > Now delete the whole class that is passing and run the test again. > >> manage test > > Now the failing one is green as well. Yes, because now you're back down to just one test, so it is again crea

Re: Using South in Django 1.7+

2015-10-08 Thread Carl Meyer
d at porting South to 1.7, but I wouldn't expect it to be easy. Carl -- 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...@goo

Re: How to run all tests in INSTALLED_APPS with the new test runner 1.6?

2015-10-07 Thread Carl Meyer
ind that a similar de facto policy exists for an increasing number of third-party apps' test suites, too. Carl -- 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 ema

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-09-21 Thread Carl Meyer
em on to Django in the first place. If you're using nginx that means setting your `server_name` directive correctly. If you're using Apache that means using a name-based (non-default) VirtualHost. Any webserver should provide some way to do this. Carl -- You received this message because you are subs

Re: Oracle XMLType and AES_Encrypt() field

2015-09-15 Thread Carl Meyer
valent to `./manage.py shell` (except for the latter will use IPython by default if installed). Carl -- 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 djang

Re: Oracle XMLType and AES_Encrypt() field

2015-09-12 Thread Carl Meyer
on an encrypted field cannot be indexed, meaning they won't scale to large table sizes anyway. HTH, Carl -- 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 em

Re: Django for data management in a no-UI application?

2015-09-08 Thread Carl Meyer
T API, built in Django. How you approach step 3 depends on whether "browser-based GUI" is acceptable, or you need to build an OS-native application. Django is oriented towards the former, but you can certainly build an OS-native Python application using a GUI toolkit like Qt or whatever, a

Re: Django 1.7 migrations: Adding one field to User`s model

2015-08-26 Thread Carl Meyer
n User to custom User. That's a real problem, and it should be fixed (but at the moment I'm not sure how to fix it). Better support for monkeypatching is not very interesting. Carl -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Turn off migrations completely in Django 1.7

2015-08-26 Thread Carl Meyer
On 08/26/2015 08:15 AM, Carl Meyer wrote: > I agree, and I already suggested a new feature (`managed=False` at the > AppConfig level) for which I think a solid patch would most likely be > accepted. This new feature would be capable of handling the "don't > migrate anyth

Re: Turn off migrations completely in Django 1.7

2015-08-26 Thread Carl Meyer
"Simple things should be easy, advanced things should be possible." > > Carl > this is not so advanced thing, and it looks almost > impossible to solve in Django. > With current architecture around migrations Django > is database owner, not one of the database service

Re: Migrating old users into custom user model

2015-08-25 Thread Carl Meyer
to migrate. And that's why the docs are simply wrong when they say that, and should be changed. See https://code.djangoproject.com/ticket/24370 Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group a

Re: Migrating old users into custom user model

2015-08-25 Thread Carl Meyer
model, to avoid this problem). Maybe the ideal scenario here is that you figure it out and then write the docs on how it's done :-) Sorry I can't give you a better answer, Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Carl Meyer
On 08/25/2015 09:23 AM, Marcin Nowak wrote: > On 25 August 2015 at 17:04, Carl Meyer <c...@oddbird.net > <mailto:c...@oddbird.net>> wrote: > > Hmm, yes, third-party apps are an issue. > > My recollection from the last time you brought this up is that we &g

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Carl Meyer
On 08/25/2015 09:02 AM, Marcin Nowak wrote: > > On 25 August 2015 at 16:53, Carl Meyer <c...@oddbird.net > <mailto:c...@oddbird.net>> wrote: > > I thought we already covered this topic, and `managed=False` should work > for your use case. That's the exact

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Carl Meyer
uot;I don't want Django to manage my database, please never touch it." Have you tried adding that flag to your models? Does something about that not work for you? Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To un

Re: Architectural suggestions for (Django + API)

2015-08-16 Thread Carl Meyer
n would even work. But if you _do_ want to share some models between two projects, for whatever reason, you can do it the same way you'd share any other code: put the models in a reusable app and install it in both projects. Carl -- You received this message because you are subscribed to the Go

Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Carl Meyer
l promised me, or it has > left me in the lurch. Can someone explain, please? Just continue with the tutorial, and read the code samples (including comments) carefully, when you reach them. Your issue when running `django.setup()` is probably entirely unrelated, but in order to debug it we'd need

Re: Question about squashing django migrations

2015-08-10 Thread Carl Meyer
re correctly captured by the first squash. > > What are your recommendations in a case like this? To go ahead and remove the old migrations, along with the `replaces` setting on the new squashed migration, as recommended in the docs. Just first make sure every deployment of your

Re: Different auth user models withoout doing multi-table inheritance

2015-08-10 Thread Carl Meyer
u know which profile table to query for that user), and it also means that you can have users with a known role who haven't created their profile yet (this may or may not be useful for your application, depending how/when profiles are created). Carl -- You received this message because you are subsc

Re: "RuntimeError: Error creating new content types."

2015-07-27 Thread Carl Meyer
be explicitly requested. `--fake-initial` should work equally well for your own apps or Django contrib apps. Did you try it and it didn't work? Or were you not aware of it? If the latter, is there someplace it ought to be documented but isn't? Carl -- You received this message because you are subsc

Re: Database inserts with autocommit set to off.

2015-07-27 Thread Carl Meyer
in 1.8: https://code.djangoproject.com/ticket/24921 The ticket describes the needed solution in some detail, it just remains for someone to code up the patch with a test. Since the issue is a regression in 1.8, I think such a patch would be backported to the 1.8 branch and appear in the next 1.8.x

Re: Migrate a many-to-many field to an explicit intermediate ("through") model?

2015-07-23 Thread Carl Meyer
he devs (or a more thorough > search on the topic) to understand why you can't switch from a simple > m2m field to one with a through option. Just because it's a bit complex to implement, and nobody has implemented it yet. Carl -- You received this message because you are subscribed

Re: Allow users to submit django form once per day

2015-07-23 Thread Carl Meyer
del class" or "the user class") doesn't work; you'll lose the data if the server restarts. Text file would work, but that's a lot of hassle to no good end when you have the database available, whose entire purpose is to store persistent data for you. Carl -- You received this mes

Re: Why is Admin login template at admin/login.html instead of registration/login.html?

2015-07-23 Thread Carl Meyer
nd regular logins look > identical, which worked very well. > So ticket 20372 is quite the opposite of my view. ;-) Presuming we made the admin use its own templates for all of this, you could achieve what you want by also overriding the admin templates and just making them inherit everythin

Re: Why is Admin login template at admin/login.html instead of registration/login.html?

2015-07-23 Thread Carl Meyer
et/20372 I agree. The auth views expose the option to pass a different template name. I think the admin should have its own templates namespaced under `admin/` and pass those template names to the views, rather than overriding the default auth templates. Carl -- You received this message because

Re: Migrate a many-to-many field to an explicit intermediate ("through") model?

2015-07-23 Thread Carl Meyer
new field with through table (using the original field name), then migrate data (using either RunPython or RunSQL), then remove the old field. I think this will work fine, and it should also remove the old auto-created through table. Good luck! I think this is definitely an area where the migrations

Re: All posts from same day django

2015-07-22 Thread Carl Meyer
On 07/22/2015 02:26 PM, Nkansah Rexford wrote: > Thanks Carl > > Also got these approaches too, might help someone > too: > http://stackoverflow.com/questions/31571607/all-posts-from-same-day-only-django I just re-read your original post, and my suggestion was wrong - it gets you

Re: All posts from same day django

2015-07-22 Thread Carl Meyer
import timedelta from django.utils import timezone now = timezone.now() one_day_ago = now - timedelta(days=1) return MyModel.objects.filter(pub_date__range=(one_day_ago, now)) Carl -- You received this message because you are subscribed to the Google Groups "Django user

Re: Testing related models without saving

2015-07-16 Thread Carl Meyer
choose to do that; differences between test and production behavior should be minimized. Carl -- 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+unsu

Re: Django formset hidden id field

2015-07-06 Thread Carl Meyer
Hi Peter, On 07/04/2015 12:42 AM, Peter of the Norse wrote: >> On Jul 2, 2015, at 7:46 PM, Carl Meyer <c...@oddbird.net> wrote: >> >>> So what? It’s quite likely that whoever is editing this row of >>> the database, also has permissions to edit the other

Re: Django model for non web applications

2015-07-03 Thread Carl Meyer
to use the ORM (which is the core of Jeff's use case). Carl > > > On Thursday, July 2, 2015 at 6:50:20 PM UTC-6, Carl Meyer wrote: > > On 07/02/2015 05:49 PM, Russell Keith-Magee wrote: > > > > On Thu, Jul 2, 2015 at 12:50 AM, Jeff Fritz <jeff..

Re: Django formset hidden id field

2015-07-02 Thread Carl Meyer
the kind of “Nice Problem to Have” that can wait until you’re bigger. Exposing primary keys themselves (e.g. in URLs) is not necessarily a security flaw. Exposing a primary key in a hidden field that can be edited to change a form to edit any row in a table often would be a serious security flaw.

Re: Django model for non web applications

2015-07-02 Thread Carl Meyer
all to > settings.configure(); details here: > > https://docs.djangoproject.com/en/1.8/topics/settings/ Don't forget that in Django 1.7+ you also need to call django.setup() yourself, if using Django outside the context of a WSGI server or management command: https://docs.djangoproject

Re: Atomic block termination question

2015-06-25 Thread Carl Meyer
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 wrote: >>>> When saving a model I'm getting a TransactionManagementError - You &

Re: Atomic block termination question

2015-06-24 Thread Carl Meyer
ete so I can get_or_create some 1:1 records >> belonging to the model being saved. Again, sample code would really illuminate what you're trying to do. Carl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: Inconsistency when importing views and models

2015-06-21 Thread Carl Meyer
> some devs prefer to use the more explicit appname.models version. Both > do the same thing. > > Check out the Django source code to see how they handle imports, and > definitely look at PEP8: > > https://www.python.org/dev/peps/pep-0008/#imports Good advice; PEP 8 gives usef

Re: Inconsistency when importing views and models

2015-06-21 Thread Carl Meyer
s Using the `.` make it explicit that you are importing from a local module relative to your current module, not from a top-level module. Carl > If, for example, your models live in a separate Django app (i.e. a > separate Python package): > > app1/ > __init__.py > vie

  1   2   3   4   5   >