Using “Schemas” with MySQL

2012-03-22 Thread Peter of the Norse
round. I’ve seen that in PostgreSQL you can use db_table = 'schema\".\"tablename' Does something similar work in MySQL? Has anyone tried it? Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the Google Groups "Django users

Re: Need help

2012-05-02 Thread Peter of the Norse
> For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@goo

Re: TypeError Exception Value: coercing to Unicode: need string or buffer, dict found

2012-05-26 Thread Peter of the Norse
;Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl

Re: model form_set can not delete

2012-05-26 Thread Peter of the Norse
end email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the Google Groups "Dj

Re: Error with Views on Admin and Index page

2012-05-27 Thread Peter of the Norse
for rock and roll >>>> I never look back >> >>>> I'm a rocker >>>> Do as I feel as I say >>>> I'm a rocker >>>> And no one can take that away >> >>> -- >>> You received this message because you

Re: Django ModelForm user best practices

2012-06-02 Thread Peter of the Norse
t; I'm sure there are more ways to achive the same result. > What are your thoughts on that ? > > When should I 'hide' (by using HiddenInput() widget) ModelForm fields? when > should I save them directly > in view? > > Does it all depend on needs or maybe there a

Re: Adding values to formdata of ModelForm before saving

2012-06-03 Thread Peter of the Norse
re subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/WyKASDjYNEgJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send

Re: How to perform a simple search ignoring characters with accents (á, é, í, ó, ú)

2012-06-04 Thread Peter of the Norse
end email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. Peter of the Norse rahmc...@radio1190.org -- You receive

Re: Python FAQ: Webdev

2012-06-07 Thread Peter of the Norse
On May 12, 2012, at 11:49 PM, Nick Apostolakis wrote: > On 13/05/2012 07:32 πμ, Peter Murphy wrote: >> All, >> >> The site recommends "Flask" by the way - not Django. The author thinks >> it is too heavyweight for his or her uses. But there seems to be a lot

Re: setting up new django project

2012-06-20 Thread Peter of the Norse
On 5/27/2012 8:53 PM, xaegis wrote: Hello, this is my first time posting to a list! I am running python 2.7 with django 1.4 installed on Ubuntu 12.04 I am having trouble creating new projects with django. Whenever I use the command: Code: sudo /usr/local/lib/python2.7/dist-packages/django/bin/

Re: 'NoneType' object has no attribute 'datetime' bug?

2012-08-14 Thread Peter of the Norse
. > end_date= models.DateTimeField(default=None, null=True, blank=True) > > > def close_coupon(self): > > current_date = datetime.datetime.now() > today = datetime.datetime.combine(datetime.date.today(), > datetime.time(19,30)) > >

Re: multiple filters on the same (reversed) foreignkey leads to multiple join

2011-09-07 Thread Peter of the Norse
quot;) > INNER JOIN "t0_child" T4 > ON ("t0_base"."id" = T4."base_id") > WHERE ("t0_child"."flag1" = True AND T3."flag2" = True AND > T4."flag1" = False ) > > I don't think that this is the e

Re: order by + group by

2011-09-13 Thread Peter of the Norse
t; ) > > in the ORM? Specifically, I want to express > > SELECT ... FROM ( >SELECT ... FROM app_model >ORDER BY field1 > ) > GROUP BY field2 > > Is it possible without writing SQL by hand? > > Thanks, > Jonas Peter of the Norse rahmc...@ra

Re: order by + group by

2011-09-16 Thread Peter of the Norse
On Sep 14, 2011, at 7:19 AM, Jani Tiainen wrote: > 14.9.2011 12:46, Jonas H. kirjoitti: >> On 09/14/2011 11:37 AM, Иван Иванов wrote: >>> The problem here is, like Peter said, that you cannot order before >>> grouping. And that's very annoying. >> >&g

Re: com_error

2011-11-25 Thread Peter of the Norse
(_GetGoodDispatch(IDispatch, clsctx), userName) >> File "C:\Python27\lib\site-packages\win32com\client\dynamic.py" in >> _GetGoodDispatch >> 85.IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, >> pythoncom.IID_IDispatch) >> Exception Type

Re: many-to-many queryset question

2012-01-06 Thread Peter of the Norse
e you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at &g

Re: Autoescape of & char ignoring safe filter

2012-11-16 Thread Peter of the Norse
I know this is months old, but I've been working on my back log. First of all, you should be using & in your URLs. They will get unescaped by the browser and show up as & when you click the link. This is so commonly overlooked that the browser will automatically escape them when loading. Then

Re: Should we have a database independent SQL like query language in Django?

2012-11-18 Thread Peter of the Norse
quot; group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/cQW4Vpc9ueYJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. >

Re: count resulting rows in sliced valuesqueryset

2012-11-23 Thread Peter of the Norse
query. However I don't see how to construct a ValuesQueryset with > a raw SQL code... sql, params = qs.query.sql_with_params() s = ValuesQuerySet.objects.raw('SELECT COUNT(*) OVER() , subquery.* FROM ('+sql+') AS subquery', params); see https://docs.djangoproject.com/en/

Re: overwrite field value in subclasses

2012-11-25 Thread Peter of the Norse
tomatically" set to UpperAbstract.CHOICE_A > In my test the created object as null value and saving it is refused on > IntegrityError because 'myfield' cannot be None > > thank in advance for any help. > regards > > manu > Peter of the Norse rahmc...@radio1190.

Re: count resulting rows in sliced valuesqueryset

2012-11-26 Thread Peter of the Norse
/models/querysets/#reverse On Nov 24, 2012, at 4:06 PM, ?manu* wrote: > On Saturday, November 24, 2012 8:03:06 AM UTC+1, Peter of the Norse wrote: > On Nov 21, 2012, at 3:53 AM, ?manu* wrote: > > > Suppose I have a queryset qs. For paginating purposes I need to do >

Re: ImportError at/ No module name

2012-12-24 Thread Peter of the Norse
'/usr/lib/python2.7/dist-packages/PIL', > '/usr/lib/python2.7/dist-packages/gst-0.10', > '/usr/lib/python2.7/dist-packages/gtk-2.0', > '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', > '/usr/lib/python2.7/dist-packages/ubuntuone-clie

django-users@googlegroups.com

2013-01-05 Thread Peter of the Norse
n formset.errors.items %} > {{ x }} : {{ y }} > {% endfor %} > {{ errors }} > > {% endif %} > > Searching by dish names, locations, and restaurants is > case-insensitive. > Searching by course uses case-insensitive exact matching. Valid

Re: Multiple model inheritance

2013-01-05 Thread Peter of the Norse
o-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the Google Groups "Django users&quo

Re: HTML Source on Browser Rendering

2013-01-13 Thread Peter of the Norse
com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > > > -- > Stavros > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discus

Re: Setting urls from project

2013-01-18 Thread Peter of the Norse
, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- Peter of the Norse -- You received this message becau

Re: Polls tutorial receive object not object representation

2013-01-31 Thread Peter of the Norse
c.poll > Out[15]: > > In [16]: p.choice_set.all() > Out[16]: [, , object>, ject>] > > Thanks > Sayth Did you add an __unicode__ method to Choice class? That's how you get the pretty representations of objects. https://docs.djangoproject.com/en/1.4/intro/tutoria

Re: initial argument in forms not working for me

2013-01-31 Thread Peter of the Norse
re subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/g

Re: django generate pdf with tables and charts

2013-02-13 Thread Peter of the Norse
of > javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it seems > that it doesn't wait for Javascript. > > Can someone suggest good solution or example? > Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the

Re: Object composition in django

2013-02-17 Thread Peter of the Norse
s" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/d

Re: How to make django's mysql connections to use utf8mb4 ?

2013-02-18 Thread Peter of the Norse
m/d/msg/django-users/-/XMNArBaFugEJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- Peter

Re: IntegrityError after updating to custom user field: django_admin_log still has fk to auth_user

2013-03-02 Thread Peter of the Norse
insert or update on table "django_admin_log" violates foreign > key constraint "django_admin_log_user_id_fkey" > DETAIL: Key (user_id)=(2) is not present in table "auth_user". > > -- > You received this message because you are subscribed to the Googl

Re: Performance when retrieving data from related models

2013-03-17 Thread Peter of the Norse
lse to match it. Most of us just use the ORM as the data retrieval layer. Again, I’m worried you’re over thinking this. Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Performance when retrieving data from related models

2013-03-18 Thread Peter of the Norse
More inline stuff. On Mar 18, 2013, at 4:14 AM, Taras D wrote: > Hi Peter > > On 18 March 2013 16:35, Peter of the Norse wrote: > You’re over thinking this by a large margin. getTendersForContractor should > return a QuerySet. That way you can add things like .select_related

Re: How to get ten random records

2013-03-22 Thread Peter of the Norse
case where the raw SQL interface might be the right answer: >> you can just tack an ORDER BY random() clause onto the query. > > Thank you kind sir > > Cheers > > Mike > >> >> -- -- Christophe Pettus x...@thebuild.com >> > Peter of the Norse

Re: Django queryset 'in' operator fails on first call

2013-04-13 Thread Peter of the Norse
I get the correct result first time using prefetch_related? > You might try converting the QuerySet into a list first. QuerySets avoid actually caching data for as long as possible. Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the

Re: export .csv file from database

2013-07-19 Thread Peter of the Norse
self.queue.truncate(0) > > def writerows(self, rows): > for row in rows: > self.writerow(row) > > The above code is exporting the database data into .csv file. > > Problem i am facing is,the exported data like Filename,Description,Notes >

Changing table name in response to a QuerySet

2015-03-16 Thread Peter of the Norse
r. The decision to choose which table to use is handled based on user settings. We would like to go back to just having the one Product model, and have its table name switch as necessary. Is there a way to do that? Peter of the Norse rahmc...@radio1190.org -- You received this message becau

Re: Changing table name in response to a QuerySet

2015-03-18 Thread Peter of the Norse
pHkndLWxi_8dCVamXJ-G7Bji3QZWcmA%40mail.gmail.com > > <https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXKkQ2Lpq1F-KBpHkndLWxi_8dCVamXJ-G7Bji3QZWcmA%40mail.gmail.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > &

Re: Different between Object-save and form-save

2015-03-18 Thread Peter of the Norse
ooglegroups.com>. > Visit this group at http://groups.google.com/group/django-users > <http://groups.google.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAMGzuy8aX8ehs4Qd2RgkueERA-OmDQg8gbE%3DVxJCB8heKw%2B03A%

Re: Changing table name in response to a QuerySet

2015-03-22 Thread Peter of the Norse
would normally generate. > > This may be one of those cases where the limitations of the ORM are being > reached, however, I'll defer any further comment to others on the list. > > -James > > > On Wed, Mar 18, 2015 at 9:35 PM, Peter of the Norse <mailto:rahmc.

Re: Migrating from sqllite3 to postgres

2015-05-25 Thread Peter of the Norse
;From sqlite: sqlite> .output backup.sql sqlite> .dump >From the command line: $ psql django_db -1f backup.sql You may have to edit the .sql file to make it work. Good luck. Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the G

Re: Scaling/Parallel patterns for a View executing complex database transaction

2015-06-14 Thread Peter of the Norse
are faster at key/value returns than PostgreSQL. Peter of the Norse rahmc...@radio1190.org -- 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: How to DRY, define a set of model-fields and reuse them as multiple instances

2015-06-14 Thread Peter of the Norse
thout having to manually add all > the fields. > > Any suggestions? There’s a django-compound-field package that seems to be what you want, but it hasn’t been updated in five years, so it won’t work with any recent version. Still, it might be a place to start from. Peter of the Norse r

Re: Django formset hidden id field

2015-06-28 Thread Peter of the Norse
don’t want to use them publicly, because your competitors can use them to gauge your success, but that’s the kind of “Nice Problem to Have” that can wait until you’re bigger. > Thank you! Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to th

Re: Django formset hidden id field

2015-07-03 Thread Peter of the Norse
a database row that doesn’t involve the PK, I would love to know. Keep in mind that most tables only have the one unique identifier. Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

Re: Webcomponents in Django

2014-12-18 Thread Peter of the Norse
his time in a different file, so it creates the new link as http://127.0.0.1/designer/elements/designer-element/elements/designer-element/designer-element.html and the process starts all over again. This isn't a Django problem but an HTML problem. -- Peter of the Norse -- You received this

Re: How to urlquote backslash in reverse arguments

2014-01-15 Thread Peter of the Norse
legroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a55c505d-e7d2-4a85-aade-761913d544e9%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Pete

Re: How to run

2017-12-11 Thread Peter van der Does
https://groups.google.com/d/msgid/django-users/ece06800-b4e5-4211-a2b2-269156bdbd0a%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout. -- *Peter van der Does o: ***410-584-2500** ** m: 732-425-3102 *ONeil Interact

Re: [ORM Foreign Keys][Performance] How to use Charfield Foreign Keys efficiently?

2017-12-21 Thread Peter of the Norse
model definition for CaseInfo2? - Peter of the Norse > On Nov 21, 2017, at 7:16 AM, Dominik Szmaj wrote: > > Hey, > > 'case_id' is a monkeypatch number(*) field so it works quick for now, not a > pk, but unique: > class OmEvent(Model): > case = Foreign

Re: I can't install easy install

2018-01-09 Thread Peter of the Norse
This is the second time I’ve seen this and need to let you know it’s not true. PowerShell doesn’t have elevated permissions, it’s just bash for .NET. While there are a bunch of new scripting features built into it, it has no effect on Python* or any other commands you might run. - Peter of

Re: Django Http request question.

2018-01-21 Thread Peter of the Norse
are starting out. The other questions are basic Python, and so I recommend you start with a tutorial. The official one is at https://docs.python.org/3/tutorial/, but I don’t know if it’s the best. - Peter of the Norse > On Jan 17, 2018, at 8:32 PM, cherngyo...@gmail.com wrote: > > I

Re: django mathfiters

2018-02-27 Thread Peter of the Norse
I would do {% with a=42 c=b.value|default_if_none:0} - Peter of the Norse > On Feb 21, 2018, at 3:47 PM, Matthew Pava wrote: > > And how are you checking if it’s None? I would do it like this: > {% if c %} > {{ a|add:c }} > {% else %} > {{ a }} > {% endif %}

Re: Migrating into Django 1.9; question about autoescape

2018-03-11 Thread Peter of the Norse
not get everything. > > This is a medium amount of effort, and if I make a mistake the users will > have a bad experience. > > Visit all of my code and all of my templates, carefully converting into the > world of autoescape-on. > Thanks in advance, > > --- Bill Torc

Re: chemistry character set

2018-03-15 Thread Peter of the Norse
the cleanup in the .save() method. My only advice is to use https://docs.python.org/3/library/stdtypes.html?highlight=translate#str.translate instead of multiple replaces. If you make the translation map a global variable, it is much faster. - Peter of the Norse > On Feb 15, 2018, at 5:55

Re: Use self-increasing arguments in numeric for-loop in Django

2018-05-03 Thread Peter of the Norse
can search the web and find many examples of people “solving” this non-problem. - Peter of the Norse > On Apr 20, 2018, at 7:49 AM, Bill Torcaso wrote: > > > I an new-ish to Django, and I ask this to hear from more experienced users > whether this would work at all, and whet

Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-06 Thread Peter of the Norse
@googlegroups.com > <mailto:django-users+unsubscr...@googlegroups.com>. > To post to this group, send email to django-users@googlegroups.com > <mailto:django-users@googlegroups.com>. > Visit this group at https://groups.google.com/group/django-users > <https://groups.

Re: Decorator function argument woes

2018-05-07 Thread Peter of the Norse
Yes, but that’s because all of the arguments are optional. That way you can do: @login_required def my_view(request): … @login_required(login_url=“/login/“) def other_view(request): … - Peter of the Norse > On Apr 30, 2018, at 12:24 AM, Mike Dewhirst wrote: > >> On 30/

Re: Field.choices get all items as json

2018-05-20 Thread Peter of the Norse
Create a view that returns json. At least if you want to use it in an ajax way. Otherwise, I would recommend just passing it as an argument to the templates that use it. import json def years(request): return HttpResponse(json.dumps(dict(Model.YEAR_IN_SCHOOL_CHOICES)), content_type=‘appl

Re: Django Multiple User Profiles Best Practices

2016-05-02 Thread Peter of the Norse
instead of a constant profile. What I would do, and I’d love to hear some debate about it, is put most (or all, depending on requirements) of the fields from the UserProfile in the new custom user model, and have two not-abstract profiles with one-to-one fields to the user. If the things in UserP

Re: manipulate n insert field values

2016-06-04 Thread Peter of the Norse
> #take 3rd bit from y cordinate (longitude) : 0 > #take 3rd bit from x cordinate (lat) : 1 > > therefore z binary value is 100101 > and z value is 37 > > #this is the technique used to convert spatial 2D indexing to 1D to improve > efficiency. > > I do not know

Re: Passing hidden foreign key to form as initial value

2016-06-06 Thread Peter of the Norse
cr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/3628bd01-59b2-4291-94f5

Re: Questions about Deploying django for production using apache and mod_wsgi.

2016-06-26 Thread Peter of the Norse
oogle.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/50b71c19-10a1-4610-8050-191bde7facda%40googlegroups.com > > <https://groups.google.com/d/msgid/django-users/50b71c19-10a1-4610-8050-191bde7facda%40googlegroups.com?ut

Re: Query annotation with date difference

2016-09-04 Thread Peter of the Norse
sers+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK52boX3b%2Bb6okqsKVXX%3DxQ7HUss9qL_BRbL8rpWFGE%3D

Re: Format of arrays in multipart forms?

2016-09-27 Thread Peter of the Norse
-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4d999852-b1eb-4b39-bbb3-46606a77d0c0%40googlegroups.com. For more options, visit https://groups.google.com/d

Re: Django MongoEngine rest api app post request.POST.get('id')

2016-09-28 Thread Peter of the Norse
57545fd3-2460-44ee-8988-079998523a54%40googlegroups.com > > <https://groups.google.com/d/msgid/django-users/57545fd3-2460-44ee-8988-079998523a54%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://

Re: Dynamic querysets?

2016-12-16 Thread Peter of the Norse
you are looking for `statedict.items()`. (Or `statedict.iteritems()` on py2) By default a dict just loops over the keys. And then it unpacks your two letter string into k, v. So the first step of your loop is k='A' and v='K'. Also, that's not how you use get. On 12/16/2016 4:19 PM, Malik R

Re: How does the django sites work

2019-01-18 Thread Peter van der Does
On 1/18/19 3:10 PM, abel otugeme wrote: > I am still learning django but I'd like to know how sites created are hosted > Google is your friend: https://www.google.com/search?q=how+to+host+django+website -- *Peter van der Does o: ***410-584-2500 m: 732-425-3102 *ONeil Inter

Re: Why use CustomUserManager.create_user and not CustomUserManager.create?

2019-03-14 Thread Peter of the Norse
The biggest difference is that when you call create_user, it creates a hash of the password. Eventually, create_user does call create, but only after setting all the values properly. Sent from my iPad > On Feb 17, 2019, at 4:30 AM, Maarten Nieber wrote: > > Hi, > > the Django guidelines tel

Re: Creating pdf in python

2019-06-27 Thread Peter van der Does
viduals(s) to fill out > different sections of the document on the web using online form(s). Is there > an Django package that will allow me to do this? > > Ex: end user will go to a web form and fill out information which will be > imported into the pdf document. > > Thank y

Re: NoReverseMatch at /sitemap.xml

2020-03-04 Thread Peter of the Norse
You are using positional arguments when you should be using named args. Change the line to return reverse('blog-detail', kwargs = {‘slug’:item.slug, ‘year’:str(item.blog_published_at.year), ‘month’:str(item.blog_published_at.month), ‘day’:str(item.blog_published_at.day)}) > On Feb 22, 2020,

Re: Django Logical Deletes on Models

2015-08-08 Thread Peter of the Norse
ps.google.com/group/django-users > <http://groups.google.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/52a0b2b6-2fb6-44ad-9ab9-fd05613c1622%40googlegroups.com > > <https://groups.google.com/d/msgid/django-user

Re: Models.clean() how to raise ValidationError WITH error_code and show field_based errors in the Form-Template?

2015-08-29 Thread Peter of the Norse
27;Now this is a valid one. P.S. I love django!' > model.name = 'Britney is gonna fail - Hit me Baby One More Time!' > model.clean() > model.save() > # validate that the error messages has the right code > the_exception = test

Re: django-admin.py startproject mysite

2015-11-10 Thread Peter of the Norse
000 I can see nothing it is not showing anything > > Actually I was giving this address cause wanted to see mysite from another > computer > and don't know why it is not working > Peter of the Norse rahmc...@radio1190.org -- You received this message because you are

Re: I'm missing something with Models and database migrations

2015-12-27 Thread Peter of the Norse
e 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:django-users+unsubscr...@googlegroups.com>. > To post to this group, send email to django-user

Re: self.publish.strftime('%m')

2016-01-30 Thread Peter of the Norse
self.publish.strftime('%m'), > self.publish.strftime('%d'), > self.slug]) > url(r'^(?P\d{4})/(?P\d{2})/(?P\d{2})/(?P[-\w]+)/$', > views.post_detail, name='post_detail'), > > i feel

Re: Reverse Foriegnkey filtering

2016-01-30 Thread Peter of the Norse
it:: > >model1.objects.filter(model2__country=my_country) > > Cheers, > > Michal You also might need to follow up with .distinct() https://docs.djangoproject.com/en/1.8/ref/models/querysets/#django.db.models.query.QuerySet.distinct Peter of the Norse rahmc...@radio1190.org --

Re: help with ManyToMany

2016-01-31 Thread Peter of the Norse
s.google.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/7512817d-d348-48b2-abf1-f3f584650cce%40googlegroups.com > > <https://groups.google.com/d/msgid/django-users/7512817d-d348-48b2-abf1-f3f584650cce%40googlegroups.co

Re: Problem uploading image Django 1.9 Python 3.5

2016-03-29 Thread Peter of the Norse
d01-bd6a-428f29466f4d%40googlegroups.com > > <https://groups.google.com/d/msgid/django-users/d89d4906-0494-4d01-bd6a-428f29466f4d%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/op

Re: variable inside @media screen

2016-04-09 Thread Peter of the Norse
You also need a max-width or this will always be true. > On Mar 11, 2016, at 2:21 AM, Rose wrote: > > @media screen and (min-width:767px){ > Peter of the Norse rahmc...@radio1190.org -- You received this message because you are subscribed to the Google Groups "Django

Re: Django tutorial part 3 - question_id vs question.id

2016-04-16 Thread Peter of the Norse
gt; wrong. You can’t use _id. The closest is the foreign key ID. Peter of the Norse rahmc...@radio1190.org -- 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: Q() chaining with & returns empty set

2016-04-21 Thread Peter of the Norse
glegroups.com>. > To post to this group, send email to django-users@googlegroups.com > <mailto:django-users@googlegroups.com>. > Visit this group at https://groups.google.com/group/django-users > <https://groups.google.com/group/django-users>. > To view this discussion

Re: about unique_together

2018-12-13 Thread Peter of the Norse
Django doesn’t support multiple primary keys. unique_together just adds an extra constraint to the table. Since you didn’t specify a primary key, id was added for you by default. Sent from my iPad > On Nov 14, 2018, at 1:55 AM, 胡超 wrote: > > > class QdProjectAssist(models.Model): > ''

Re: best way to generate PDFs in django - handling concurrency

2018-12-27 Thread Peter van der Does
s available to generate PDF's which might be much faster but for us the open source application works fine. wkhtmltopdf: https://wkhtmltopdf.org/ -- *Peter van der Does o: ***410-584-2500 m: 732-425-3102 *ONeil Interactive, Inc * oneilinteractive.com <http://www.oneilinteractive.com/> ** --

Re: How 2 access the Primary model's ID in the Foreign model??

2018-12-31 Thread Peter of the Norse
Also song.album_id will work as well, and faster too. Sent from my iPad > On Dec 4, 2018, at 3:43 PM, Mike Dewhirst wrote: > >> On 5/12/2018 7:07 AM, Sourajit Mohanty wrote: >> I have 2 model classes Album and Songs(where Song is the Foreign key) >> I want to access the Albums ID in the Songs c

Deploying Django multi servers, 1 DB server

2019-01-03 Thread Peter van der Does
d and they can start doing the next steps. We're open to using any DevOps tool, Ansible, Puppet, Chef. We don't do any form of CI, nor are we planning to do so in the near future. If more details are needed let me know and I can provide them. -- *Peter van der Does o: ***410-584-2500

Re: How to access using foreing key

2020-12-13 Thread Peter of the Norse
If you are looking for all of the Restaurants with a 5.0 rating, it looks like Restaurant.objects.filter(rating_restaurant__rating = 5.0) If you are looking for Restaurants with an average rating of 5.0, that’s a bit trickier. from django.db.models import Avg Restaurant.objects.annotate(avg_rat

Re: ForeignKey with different queryset from manager

2021-01-10 Thread Peter of the Norse
This is an interesting question. Thank you for asking it. I wasn’t able to find exactly what you are asking for. The closest I could find was https://docs.djangoproject.com/en/2.2/topics/db/queries/#using-a-custom-reverse-manager

Re: How to securely store passwords used in backend code

2021-01-10 Thread Peter of the Norse
I use multiple settings.py files to do this. Specifically, in my main one, I have what I consider the only acceptable instance of import *. import os if (os.getenv('PRODUCTION')): from .prod_settings import * else: from .dev_settings import * While dev_settings.py is in my repo, prod_se

Re: QuerySet performance on large datasets

2021-02-12 Thread Peter of the Norse
bool(qs) is recommended when the queryset has already been run. If you do something like val = qs.earliest(some_property) if bool(qs) else None then there isn’t a performance gain because it still has to run qs.exists() to even see if there is a value. Later things like that will be cach

Re: What values is expected for CSRF_COOKIE_PATH ?

2021-03-08 Thread Peter of the Norse
Some sites have Django installed in a sub-path of their site, e.g. http://mydomain.com/django/. In that case, you can set it to “/django-project/“ or “/“. Since the default is / you don’t need to do anything. If you have two separate Django installations on one site, then you need to change

Re: QuerySet performance on large datasets

2021-04-11 Thread Peter of the Norse
taff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user"; args=() (0.000) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user&q

Re: Question about models. test

2021-05-02 Thread Peter of the Norse
This kind of script can be dangerous. It’s possible for malicious websites to create a page that can use up too many resources or otherwise act strangely. URLValidator

Re: Django 3.1 Makemigrations fails with FilePathField but succeeds with CharField

2021-06-22 Thread Peter of the Norse
I think you might be better off using https://docs.djangoproject.com/en/3.2/topics/migrations/#squashing-migrations than having it recreate all of them. > On Mar 18, 2021, at 8:28 AM, Olivier wrote: > > Hello, >

Re: I am new in Django. Getting below errors when i am trying to install psycopg2. Please help me.....

2019-10-10 Thread Peter van der Does
Literally the first search result on google: https://www.google.com/search?q=psycopg2+ld%3A+library+not+found+for+lssl Google and Stack Overflow is my workflow. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: https setup

2019-11-11 Thread Peter van der Does
ups.google.com/d/msgid/django-users/b8030e6a-e5a7-47fd-afcd-bc5a0c0ebc6b%40googlegroups.com?utm_medium=email&utm_source=footer>. -- *Peter van der Does o: ***410-584-2500 m: 732-425-3102 *ONeil Interactive, Inc * oneilinteractive.com <http://www.oneilinteractive.com/> ** -- You rec

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

2017-01-15 Thread &#x27;Peter Müller' via Django users
1.10 Docs/Tutorial) I need to import the model class into the view file and for example use models.user.all(). However on import of the view Django complains about django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet What is the solution to that problem? Greetings Peter -- Yo

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

2017-01-16 Thread &#x27;Peter Müller' via Django users
blindly copying code. Thanks Peter Am Sonntag, 15. Januar 2017 22:11:30 UTC+1 schrieb Mike Dewhirst: > > On 16/01/2017 5:01 AM, 'Peter Müller' via Django users wrote: > > Hello everybody. > > > > > > I just began learning how to use django. So I wanted t

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

2017-01-16 Thread &#x27;Peter Müller' via Django users
For the traceback: http://pastebin.com/Wy7And6M And the views configuration: http://pastebin.com/q0V3bQay thanks Peter Am Montag, 16. Januar 2017 15:53:42 UTC+1 schrieb Daniel Roseman: > > On Sunday, 15 January 2017 18:03:54 UTC, Peter Müller wrote: >> >> Hello everybod

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

2017-01-16 Thread &#x27;Peter Müller' via Django users
Well else python doesn't find the view.py file? Am Montag, 16. Januar 2017 21:20:53 UTC+1 schrieb Daniel Roseman: > > On Monday, 16 January 2017 15:53:56 UTC, Peter Müller wrote: >> >> For the traceback: http://pastebin.com/Wy7And6M >> And the views configuration:

<    4   5   6   7   8   9   10   >