Re: Agricultural and livestock marketplace plus social network as a whole

2024-03-15 Thread Michal Plsek
1/ looking like 100k production product, dont really think this can seriously be deployed by couple of volunteers (even if there is future split of 20%, which is not so much for this kind of job btw) 2/ look if django-oscar has api you could use, it already has 75% of required functionality 3/ or

Re: ANYONE TO HELP ME ON HOW TO CREATE AN AUTOMATIC NOTIFICATION SYSTEM THAT SENDS A MESSAGE WHENEVER AN OBJECT IS CREATED OR MODIFIED

2023-09-04 Thread Michal Plsek
Just register post_update signal with the Model you want to "watch" to be created/updated, and in optimal case send message to some asynchronous queue, which will take message 15 minutes late and processes it by creating Notification object. For example async queue = aws sqs, they even support

Curious about ModelAdmin internals.. how the hell does it work

2021-09-01 Thread Michal Plsek
Hello, I would like to know about this (although I hacked around it, but I am still curious): if I have model which contains ForeignKey attribute and I am using autocomplete_fields on it, where is the found FK of foreign object saved on ModelAdmin page? Numerical ID of foreign object

Re: How to find out when a fix will be released

2019-09-12 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Aug 28, 2019 at 01:59:01PM +0800, wd wrote: > > > > As a concrete example, consider a moment in time halfway between the > > release of Django 5.1 and 5.2. At this point in time: > > > >- Features will be added to development master, to

Writing a text file from Form input

2019-09-08 Thread Michal Pavliš
Hello, so i'm writing a program that uploads invoices to an accounting webapp based on order info from Wordpress. At one point, the code takes an order number, fetches order data using the WP REST API and is supposed to write a .txt file in a specified location containing mentioned order

Re: Django security releases issued: 2.2.2, 2.1.9 and 1.11.21

2019-06-03 Thread Michal Petrucha
il: https://www.djangoproject.com/weblog/2019/jun/03/security-releases/ And there's no need to send your reply to all three mailing lists where this release was announced. ;) Michal > On Mon, Jun 3, 2019 at 7:17 PM Carlton Gibson > wrote: > > > Today the Django team issued 2.2.2, 2.1.9, an

Re: Re: Composite Primary / Foreign Key support

2019-02-19 Thread Michal Petrucha
I get that it's frustrating. Either way, that's where we are today. Cheers, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcbBq2AAoJEHA7T/IPM/kl/oQQAIGotHVDPhiD646CZ3hACeqX c0+U9g2fwhDl8yVauh+Ra9BSCY74TBYNky72PpBOJJF27q+QTTaGObG7j+Iiua/T GWMYQNixaZrxxKhDYT

Re: Composite Primary / Foreign Key support

2019-02-11 Thread Michal Petrucha
here). Keep in mind that this is an internal API, so it might change without warning. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcYXniAAoJEHA7T/IPM/kl8EAP/Rzaxqe0bDO6vkxb4/Mmmj5S 62t6Cfm3VqqK6NxYjRXG904jKwDI4HMH1SAs5fdVMh9vf+VBj/S5bcIpQbesqXbh wbkcIn+mmnfh

Re: Logging of full trace with Debug set to False

2019-01-28 Thread Michal Petrucha
I don't remember exactly how, and I don't have access to that code base anymore, but I remember that we had to explicitly disable as much of Celery's custom logging as we could in order to get that to work. (Might be that things have improved since then, though.) Good luck, Michal -BEGIN PG

Re: Logging of full trace with Debug set to False

2019-01-28 Thread Michal Petrucha
use the commercial offering [2]. If you set up sentry as one of the default logging handlers, it will catch all unhandled exceptions, and you'll get a fancy stack trace for each, including the values of local variables in each stack frame. Cheers, Michal [1]: https://github.com/getsentry/s

Re: Questions about MySQL notes in Django docs

2019-01-23 Thread Michal Petrucha
er the rest of your questions, but here's a discussion that might shed some light on this for you (along with the tickets linked from that thread): https://groups.google.com/d/msgid/django-developers/1c8af1c8-23dd-4c79-85ce-9486290ae73f%40googlegroups.com Michal -BEGIN PGP SIGNATURE- Version: GnuPG

Re: problem in activating virtual environment in Django with ". \Scripts\activate" command

2019-01-18 Thread Michal Petrucha
tFound: (\Scripts\activate:String) > [], CommandNotFoundException > + FullyQualifiedErrorId : CommandNotFoundException > > PS E:\todo> Hi Aditya, The correct incantation for Powershell is .\Scripts\activate.ps1 The version without any extension, or with .bat, would be correct if you were running s

Re: No module named django.core.wsgi, Apache+ CentOS

2019-01-16 Thread Michal Petrucha
s you need to insert into your apache config in order to use that build of mod_wsgi. More details are explained at https://pypi.org/project/mod_wsgi/#connecting-into-apache-installation. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcPv4XAAoJEHA7T/IP

Re: Problem with testing on Travis CI

2019-01-16 Thread Michal Petrucha
o make it impossible for you to run migrations in a fresh, empty database. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcPvvRAAoJEHA7T/IPM/kl4gsP/j2Pyl8YQsUi94saQFnIaEIH sxQ28wm4a5vlfAyKxDDNZqcBBwVq0YPkpflEe5DnmFjQdcsanjZgxt+ejwwONmFF +kP7gjD1mPmGG4V2XT

Re: Using the Models from two Different Projects in a single script

2019-01-15 Thread Michal Petrucha
ther management command in the other project to import the exported data (again, either write your own custom importer, or use loaddata, depending on whether you need to transform it in any way). Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcPbANAAoJEHA7T/I

Re: migrate failed due to Permission

2019-01-14 Thread Michal Petrucha
queries that you're executing in module scope should go into functions and methods that you only call when you actually need that data. It would be easier to give you more specific advice if you posted the relevant parts of your code, though. Good luck, Michal -BEGIN PGP SIGNATURE-

Re: Set default value in field dependant on another model?

2019-01-14 Thread Michal Petrucha
business logic layer for the default number of things to request in a new “Quota” for that specific resource, and then pass that number to your form as the “initial” argument. Cheers, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcPMF3A

Re: Can a class which inherits from factory.DjangoModelFactory use Django TestCase asserts?

2019-01-14 Thread Michal Petrucha
s of times during one run of your test suite. As I understand it, you want to test your factories, which is a good idea. What I suggest you do is to just write a separate test module for your factories. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGB

Re: Creation of database in real time and loading it in the DATABASES variable of Django;

2019-01-08 Thread Michal Petrucha
ch solve this separation using one Postgres schema per tenant in a single database. Right now the one that appears to be maintained would be https://github.com/tomturner/django-tenants. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJcNMOzAAoJEHA7T/IPM/k

Re: how to fix this problem using 2.1.3 version

2018-11-26 Thread Michal Petrucha
On Mon, Nov 26, 2018 at 04:34:42PM +0200, Yavin Aalto Arba wrote: > It's kinda all over the place. > > 1. conventions: > urlpatterns is a list not a tuple > 2. > 'restaurants.views', without include? what's this for? > > 3. You did not close the parenthesis correctly in the second item, here's

Re: how to fix this problem using 2.1.3 version

2018-11-26 Thread Michal Petrucha
On Mon, Nov 26, 2018 at 02:48:25PM -0800, Abba Haruna wrote: > # from django.conf.urls import patterns, url > from django.conf.urls.static import static > from django.views.generic import ListView > from restaurants.models import Food > from django.conf import settings > > urlpatterns =

Re: Update profile on login

2018-11-12 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Nov 09, 2018 at 08:32:28AM -0800, pastrufazio wrote: > Il giorno venerdì 9 novembre 2018 11:37:23 UTC+1, Michal Petrucha ha > scritto: > > Found it. :) The error lies in the filter() call: > > > > Thank you ver

Re: Update profile on login

2018-11-09 Thread Michal Petrucha
callables. Cheers, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJb5WMVAAoJEHA7T/IPM/klwgkQAJpdDsTNeCFKnmcDpmXPs+S7 vQy+aEyaV3VkfgCpH92n/3Csvad5Fw4cloSef+4DIR1897Hj2x7ga8HA7chcPdJ5 g/mZQNti54ILJMOnWAISD5jPlikec9eibfs06PPSdJnz5O3fcN1hPAy5klWNyEDd nL4u9IXqWeo8R

Re: Update profile on login

2018-11-09 Thread Michal Petrucha
below > > *TypeError at /admin/login/ int() argument must be a string, a bytes-like > object or a number, not 'ModelBase'* > > Any help would be really appreciated! Hi, Could you please post the full stack trace rather than just the final error message? That would make it easier

Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Michal Petrucha
https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbze/JAAoJEHA7T/IPM/klbT8QAOLnyQUXGiJWWyXk0p1bEDMN cECp9OkfvZsugvSkubXJF1RppLS9dv4CaPoC2dplC/HjPJeE/4hTtdvZ

Re: Using Primary key in two fields

2018-10-17 Thread Michal Petrucha
d, just use unique=True instead. That will tell the database that icatid is a secondary key. Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbxyMqAAoJEHA7T/IPM/klo8AP/i83PGOzi7+rwqc566VqdYT9 DY5SF9Vh/NAhCAxNVaC369yXRr2/L2EE0T3mDe9hMv/fSbSp00D25kFwsdLDC5TA +tIzLN53777mAWFzTIjRhzQuc8u

Re: Form Code getting executed during django project startup

2018-10-12 Thread Michal Petrucha
runtime, whenever the form is instantiated: class SomeForm(forms.Form): field = forms.ChoiceField(choices=get_choices) Good luck, Michal > > > def get_choices(): > return some choices > > > In views.py, I have imported SomeForm: > > from app.m1 import SomeForm &g

Re: Alternatives to using __contains?

2018-10-10 Thread Michal Petrucha
g if your only reason is that you don't like the kwargs-based API of relationships, expressions, and filters. Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbvgpYAAoJEHA7T/IPM/klaZkP+wTJ+l3p+DPN/KJPAabMKf95 llom243U4TJ1DhWjr/Ca6PrkseCU7ZKN6EY/oCXIy6fGLNHNsRm31HO

Re: how to create, read, update and delete other dependent tables in detail view Django

2018-10-10 Thread Michal Petrucha
to perform CRUD operations on > Dependent and Document table > > Pls can anyone provide th solution > > Thankyou I suggest that you start here: https://docs.djangoproject.com/en/2.1/topics/forms/modelforms/#inline-formsets Michal -BEGIN PGP SIGNATURE- Ve

Re: Alternatives to using __contains?

2018-10-10 Thread Michal Petrucha
nships, expressions, and filters with __ in keyword arguments is how this is done in Django, and it's most likely going to stay that way for the foreseeable future. Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbvb0CAAoJEHA7T/IPM/klndQP/Rd91q/4ANlPzkIzzJd3xRuX xrJgvFnWNnv9t

Re: Django 2.1.1 creating CharField in a Form in Django on a Raspberry pi

2018-10-09 Thread Michal Petrucha
prised that doesn't raise an error. Regardless, you should remove the spaces around “form”, and then you'll be able to refer to the form as, well, “form” in your template. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbvKE4AAoJEHA7T/IPM/klQToP/0+5qNMWutLRDIkvYd

Re: "No such table" error, with different tablename as in query

2018-10-08 Thread Michal Petrucha
defined in your settings, and a router that directs write queries for the Transaction model to the wrong one? Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbu3YYAAoJEHA7T/IPM/klrZ8P/1FAI/sm5UEMOUSnxjLM6fI+ /9Lu7/7ZhFvKFVXOSa6GT2pxEjOkdLmtmMwQv1ghvxgvCmVMEohOKoNDPDwhdEGA

Re: Not Able to Connect to Vertica

2018-10-04 Thread Michal Petrucha
ORM support anyway. All in all, it doesn't seem to be feasible to use a Vertica database with Django at this point, at least not with open-source libraries. Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbth25AAoJEHA7T/IPM/klkOcP/A5tInkEz2L42/TRPpZ

Re: Running a single version of my Django app but with two databases: one for dev and one for prod

2018-10-03 Thread Michal Petrucha
ou'll make your life a lot easier if you just make two separate deployments sitting on separate domains. (A relatively common approach is to use a “dev.” or “staging.” or “beta.” subdomain of your main domain for the dev/testing/staging environment.) Good luck, Michal -- You received this message

Re: Geodjango Error

2018-10-02 Thread Michal Petrucha
rectory delimiter, make sure to either use a raw string literal (r'c:\path\to\my\gdal.dll'), or double-backslashes ('c:\\path\\to\\my\\gdal.dll'). Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbsxTVAAoJEHA7T/IPM/klLA0QANjRJZjywvglG74qJQujhyK3 F0FkcN6RVXlwZv2XBq21NufpItQ

Re: Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Michal Petrucha
Not sure if there's anything like that for mysql. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbojg9AAoJEHA7T/IPM/kljwwP/0kKZ3CwgUl9OxNB2THxcQEJ ioDPkLIiF6HLRHhnBo29wZJX+2ngrh1lMagUZLJ7FpnPCl6IUyf1hmE4WyRU17fn 93ypqt2HLgz5HFKtvcRO5tGIQUf7BGa

Re: Recreate all tables in mysql after dropping the database

2018-09-17 Thread Michal Petrucha
s a magic silver bullet to fix all database problems, and once you have a migration that does what you want it to do, commit it into the revision history of your code base. Good luck, Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJbn1kHAAoJEHA7T/IPM/klAxQQAIRjUj2R5XFOO0Q457

Re: Contributing to Django

2018-09-07 Thread Michal Petrucha
lved! I'd suggest that a good place to start would be https://docs.djangoproject.com/en/2.1/internals/contributing/ Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: Trying to replace a char field with a forgein key feild

2018-08-29 Thread Michal Petrucha
you wrote suggests that this should in any way fail, as long as operations 1, 2, and 4 are performed with AlterField, AddField, and RemoveField, and you use model classes passed into RunPython through the ``apps`` argument. Could you perhaps provide some more details about the failure that you're expe

Re: How to delete least recently used not expired django sessions?

2018-08-20 Thread Michal Petrucha
an find a bunch of material on this topic. For example, this article seems to consider a lot of potential attack vectors: https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence#title.2 Michal -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBCgAGBQJben

Re: Django Generic Date Views

2018-08-10 Thread Michal Petrucha
ng I should know, but don't. > > As it is getting late here I will be taking another look at this tomorrow. Michal [1]: https://docs.djangoproject.com/en/2.1/topics/class-based-views/intro/#decorating-class-based-views -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQ

Re: Django Generic Date Views

2018-08-09 Thread Michal Petrucha
o you'd typically just set that as the ``queryset`` attribute on a generic view, and then every time the view is executed, it will take that unevaluated queryset, add all the necessary filters to only select items for today, and then fetch those. Michal -BEGIN PGP SIGNATURE- Vers

Re: Django Generic Date Views

2018-08-09 Thread Michal Petrucha
classes. In this case, all of the generic date views by default look at the ``queryset`` class attribute when they want to read objects from the database, not ``vi``, which is why you'd typically use that name in your subclass. Good luck, Michal -- You received this message because you are subsc

Re: Model formset not saving

2018-07-18 Thread Michal Petrucha
delFormSet.save() always does: https://github.com/django/django/blob/stable/2.1.x/django/forms/models.py#L657-L669 As for why nothing is created in the database – are you also updating the management form of the formset on the frontend to indicate that you have added a new form, and that the forms

Re: how to programmatically get the index name of a model field on a migration of django 1.8

2018-07-02 Thread Michal Petrucha
ast EOL, and use the more explicit support for indices introduced in 1.11, but I have no idea how much easier it would make to solve your problem. (You should consider upgrading regardless, though.) Good luck, Michal -- You received this message because you are subscribed to the Google Groups "Djan

Re: ARGPARSE ERROR

2018-04-13 Thread Michal Petrucha
to a newer Python; if the latter, then you need to fix your Python installation, and make sure that it includes the entire standard library. Good luck, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: single queryset from multiple tables

2017-09-18 Thread Michal Petrucha
d sorts the combined list in memory. Then you'd be taking the result of that sorting routine, and pass that to the paginator, which would discard all but 50 items from the potentially huge list of model instances. I don't think there's a way to not do this with the sorting that is built-in in Python, beca

Re: Dynamically adding a field to a model - via contribute_to_class

2017-09-13 Thread Michal Petrucha
executed, it adds each of them as another column to the table, which is obviously wrong. As for what you could do to avoid this situation – I'd suggest that you add an extra argument to PriceField which tells the field that it shouldn't create the additional extension field. Then, you implement the dec

Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Michal Petrucha
might have to investigate if there's perhaps some cached attribute that doesn't get cleared. Good luck, Michal -- 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

Re: Dynamic model, reverse foreign key not working

2017-09-05 Thread Michal Petrucha
d, the new field or relation won't be reflected in them, leading to errors just like yours. There's an internal undocumented API that takes care of this, Model._meta._expire_cache(), which will clear all those caches. It should do the trick for you, but as always with private APIs, be aware that i

Re: ValueError: Need 2 values to unpack in for loop; got 3 (actually num_loopvars = 2 and len_item = 3)

2017-07-17 Thread Michal Petrucha
{% endfor %} The problem is that mylist contains triples, not pairs. It would help a lot if you could show the actual template code, as well as the context that you pass to the template. Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Djang

Re: Possible bug - Incorrect escaping in Django SQL query

2017-06-02 Thread Michal Petrucha
this double-percent escaping appears to be wrong there. I did a quick search through the issue tracker, and didn't find anything about this issue, would you mind submitting a new bug report? It would be best if you could include a complete minimal example that we could easily run to reproduce

Re: Generating HDF5 and downloading

2017-05-02 Thread Michal Petrucha
ocs, the “core” file driver with backing_store=False might do the trick, but I don't see how you could then read the byte stream of the in-memory file afterwards. Barring that, you'll need to create a temporary file (for example with the tempfile module [2]), write the HDF5 file there, read it into th

Re: First models.py needs tuning

2017-04-21 Thread Michal Petrucha
Python. Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, s

Re: First models.py needs tuning

2017-04-21 Thread Michal Petrucha
key field to all your tables and models. Cheers, Michal -- 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

Re: Let's Encrypt installation fails with WSGI on Ubuntu 14 LTS

2017-03-25 Thread Michal Petrucha
's no risk that the config automagic won't work with the config directives used in your particular config, there's no need to reload the webserver on each run, and in general, I personally distrust any magic that messes with my configuration. Good luck, Michal -- You received this message beca

Re: How to keep track of online users?

2017-03-03 Thread Michal Petrucha
ware to update it automatically. > Code > above contains ample hints for you to start digging. Keep in mind that this will only work if you use a model-based session storage; if you use a storage like the signed_cookies session backend, this will not be possible. Cheers, Michal -- You received this me

Re: Django Migrations?

2017-03-02 Thread Michal Petrucha
In this case (and now I'm just guessing, because you haven't provided a lot of detail in your problem description), it might be that you have a broken migration in your repository that you'll need to fix. If that is the case, could you also post the code of the migration file that is failing? Cheers, Mic

Re: "TemplateDoesNotExist at /"

2017-02-25 Thread Michal Petrucha
unlike TemplateResponse and render, the code above will not apply context processors, unless you change that Context to a RequestContext, which is something that's super easy to forget, and I've actually seen people get bitten by that in the past, and spend a lot of time trying to figure out why their

Re: Difference

2017-02-15 Thread Michal Petrucha
ning with the letter “T”, you'd use the related_query_name in the queryset filter: Reporter.objects.filter(articles_written__title__startswith="T") Does this make it more clear? Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Dj

Re: Django allauth, manage redirect

2017-02-07 Thread Michal Petrucha
n-up process or not. Good luck, Michal [1]: https://django-allauth.readthedocs.io/en/latest/advanced.html#custom-redirects -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Separator between forms in formset factory

2017-01-28 Thread Michal Petrucha
.djangoproject.com/en/1.10/_modules/django/forms/formsets/#formset_factory> > . > > Kind regards, > Jeroen Hi Jeroen, Have you considered simply iterating over the individual forms in your template, and including the separator in the for loop? You can find some ex

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

2017-01-16 Thread Michal Petrucha
turn imports models. Just removing the “from . import views” line should let you move forward – unless you also have other imports in the __init__.py file, in which case you can most likely just remove them, too. In general, in an average Django package, there's little reason to import stuff in its root p

Re: models foreign key

2017-01-15 Thread Michal Petrucha
then I'm afraid you'll have to provide more details than “it's not working” – what steps did you take exactly, what was the output, what output did you expect, etc. Good luck, Michal > *please help, Thanks. * > > > class *Author*(models.Model): > *Author_code = models.CharF

Re: Dynamic Models

2017-01-05 Thread Michal Petrucha
l kinds of field caching, but also things like the way relationship fields are resolved on startup. So even if you put something together that appears to kind of work, expect there to be a lot of corner cases and things that outright won't work. Good luck, Michal -- You received this message

Re: request.read() is empty in POST

2017-01-04 Thread Michal Petrucha
xception on you, complaining that you cannot access body after reading from request's data stream, that means you need to look at any code that's executed before that line and track down what is performing that read earlier. Good luck... Michal -- You received this message because you are

Re: Multiple Fields as Primary Key in MySQL - Django 1.10

2017-01-03 Thread Michal Petrucha
an huge ORM refactoring and a huge testing > refactoring, let my work hard to maintains. What I understand after the 1.6 > release is that this fe external library. > > As I know Michal Petrucha make a good job on GSoc 2011. > However, I don't know when is in planning the compos

Re: validate_email returns None for any or format

2016-12-21 Thread Michal Petrucha
;>> print x > None > >>> > > Shouldn't it be returning True or False? According to https://docs.djangoproject.com/en/1.10/ref/forms/validation/#validators: > A validator is merely a callable object or function that takes a > value and simply returns nothing if t

Re: Phone number field in form/ model

2016-12-14 Thread Michal Petrucha
st/, and take some inspiration from them. Cheers, Michal -- 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 po

Re: Installing django on python3.5.2. Debian

2016-12-13 Thread Michal Petrucha
that you will overwrite some of the essential repository-installed packages with pip, which can render your entire Python installation unusable. This does happen to people quite often, and it's quite difficult to recover from. Good luck, Michal -- You received this message because you are s

Re: Extending FieldField (the way ImageField does)

2016-11-20 Thread Michal Petrucha
lementations backed by a simple TextField. Option 2 will be easier to implement and maintain than option 3, I think, whereas option 3 is more “pure” in terms of relational database design. Good luck, Michal -- You received this message because you are subscribed to the Google Groups "Django u

Re: django_admin database creation, after sql command depreciated

2016-11-18 Thread Michal Petrucha
ve appended my > application to the list in my settings.py. I got suspicious that I > need to add my application separately to the installed_apps list. Nothing like that. As you noted above, you are getting the error about a missing table before Django ever gets a chance to start applying the

Re: Setting up jQuery in debian with virtualenv

2016-11-10 Thread Michal Petrucha
ally does not care where the static file is coming from, as long as you configure your static file finders to see the file. Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: External access

2016-11-07 Thread Michal Petrucha
runserver 0.0.0.0:8000 Good luck, Michal -- 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 g

Re: Django1.9 Mongodb support

2016-11-04 Thread Michal Petrucha
data stores, and the last time I checked, neither of those projects was maintained anymore. May I ask if you have any specific reason to want to use mongo with Django? If not, you're most likely better off using Postgres instead, which has excellent support in Django. Cheers, Michal -- You received

Re: Redirect after Form

2016-10-31 Thread Michal Petrucha
> #return redirect('views.company_detail', pk=company.pk) > > > And it works fine! Just for the record, you should also be able to use this:: return redirect('crm:company_detail', company.pk) (That should be equivalent to the explicit HttpResponseRedirect with reverse().) Cheers, Michal

Re: Visiting one Django server logs me out of another Django server, both behind the same proxy

2016-09-30 Thread Michal Petrucha
Hi Mike, On Fri, Sep 30, 2016 at 06:00:30AM -0700, Stodge wrote: > Thanks Michal, > > The two servers are on the same domain and use different databases. At the > moment I'm using the default Django session backend. > > It's an experiment, nothing more really. I just wanted

Re: Visiting one Django server logs me out of another Django server, both behind the same proxy

2016-09-30 Thread Michal Petrucha
f which would be affected by this. You might want to share some more information, such as: - Are those two applications sharing one database? - What session backend are you using? - Are they on the same domain? (this one I've already asked above) - Could you describe the SSO flow in a bit more det

Re: Cache-Control header for Flat Pages

2016-09-29 Thread Michal Petrucha
On Thu, Sep 29, 2016 at 05:17:54AM -0700, Web Architect wrote: > Hi Michal, > > Thanks for your response. My mistake that I should have mentioned that we > are using Django 1.8. The decorator cache_control I think was introduced in > 1.9. Would there be something similar in

Re: Cache-Control header for Flat Pages

2016-09-29 Thread Michal Petrucha
cached_flatpage = cache_control(max_age=4700)(views.flatpage) urlpatterns += [ url(r'^about-us/$', cached_flatpage, {'url': '/about-us/'}, name='about'), url(r'^license/$', cached_flatpage, {'url': '/license/'}, name='license'),] Cheers, Michal -- You received this mes

Re: cannot import name SortedDict

2016-09-20 Thread Michal Petrucha
have to try restarting it – most of the time, runserver tries to reload itself automatically, but there are pathological cases where it doesn't work). If that doesn't help, try checking if there are any stale leftover .pyc files, and try removing those. Good luck, Michal -- You received this m

Re: Random 404 instead of 301 for URLs without trailing slash

2016-09-16 Thread Michal Petrucha
do not match any URL pattern. It is possible that you have a catch-all urlpattern that happens to match your URL without a trailing slash, and then raise an explicit 404 – this might happen, for instance, if you're using something like a wiki application, or a custom handler for flatpages, included un

Re: Django exit function

2016-09-10 Thread Michal Petrucha
en't been able to extract much useful information at a glance, but you might be able to find something that suits your need. Cheers, Michal [1]: http://docs.gunicorn.org/en/latest/settings.html#on-exit [2]: https://uwsgi-docs.readthedocs.io/en/latest/Hooks.html -- You received this mess

Re: How modify Django to set URLs with decorators on the view functions like Flask? (rather than using urls.py)

2016-09-10 Thread Michal Petrucha
running in a semi-broken state happily without ever telling anyone. Cheers, Michal -- 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+un

Re: Maintaining old django code

2016-09-06 Thread Michal Petrucha
policy was still just in the works, and the usual “two releases” policy applied. So no, at the very least, when going from 1.4 to 1.8, you should make an intermediate stop at 1.6, but if you want to minimize the pain, going through every single feature release would probably be the best i

Re: django.core.exceptions.FieldDoesNotExist but the field exists

2016-09-05 Thread Michal Petrucha
autodetector is trying to get the model field from a previous state of the models, which is determined from the migration history, not the current model definitions. Have you by any chance made any changes to any of the existing migrations? I can imagine that this could happen if one of your migrati

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-31 Thread Michal Petrucha
this: A.objects.filter( b__in=B.objects .annotate(max_date_created=Max('a__b__date_created')) .filter(date_created=F('max_date_created'), text='ABCD') ) Good luck, Michal -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Attribute error, with a very basic banking app

2016-08-26 Thread Michal Petrucha
uk/, which is an invaluable resource whenever you're doing anything with CBVs that involves more than setting the ``template_name`` and ``model`` attributes. In my opinion, CCBV makes a lot of the pain involved in dealing with CBVs go away. Cheers, Michal -- You received this message because you

Re: Starting new project -- version 1.10

2016-08-23 Thread Michal Petrucha
planation makes sense, and feel free to ask if there's anything unclear. Cheers, Michal -- 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 djan

Re: receiving PNG file in django

2016-08-22 Thread Michal Petrucha
On Mon, Aug 22, 2016 at 11:10:38AM -0400, Larry Martell wrote: > On Mon, Aug 22, 2016 at 11:00 AM, Michal Petrucha > <michal.petru...@konk.org> wrote: > > On Mon, Aug 22, 2016 at 10:11:49AM -0400, Larry Martell wrote: > >> When I get the request, request.FILES is

Re: receiving PNG file in django

2016-08-22 Thread Michal Petrucha
uld most certainly not be the correct way, since it would mangle about one half of the input data into ASCII. > Any suggestions on how I can make this work? You'll have to make sure that the request is correct, I'm afraid. Good luck, Michal [1]: https://github.com/django/django/blob/a8f957797

Re: Starting new project -- version 1.10

2016-08-22 Thread Michal Petrucha
s create a models.py file in there (next to the existing urls.py, if you need any models), views.py (if you need views), and add 'crm' to ``INSTALLED_APPS``. That's pretty much the same thing as what startapp would have done, anyway. Good luck, Michal -- You received this message because you a

Re: Odd problem: some database updates do not appear on other pages until server restart

2016-08-19 Thread Michal Petrucha
On Fri, Aug 19, 2016 at 02:38:02PM +0200, Michal Petrucha wrote: > On Fri, Aug 19, 2016 at 05:02:39AM -0700, bobhaugen wrote: > > On Friday, August 19, 2016 at 5:20:45 AM UTC-5, Michal Petrucha wrote: > > These questions remain unanswered, although I intend to do a bunch mo

Re: Odd problem: some database updates do not appear on other pages until server restart

2016-08-19 Thread Michal Petrucha
On Fri, Aug 19, 2016 at 05:02:39AM -0700, bobhaugen wrote: > On Friday, August 19, 2016 at 5:20:45 AM UTC-5, Michal Petrucha wrote: > > > > Could you show us the code of with_user? Maybe it does not return an > > unevaluated queryset? > > > > > def w

Re: Odd problem: some database updates do not appear on other pages until server restart

2016-08-19 Thread Michal Petrucha
u show us the code of with_user? Maybe it does not return an unevaluated queryset? Cheers, Michal -- 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: selectively requiring login

2016-08-01 Thread Michal Petrucha
even something based on OAuth, or perhaps JWT. The Django REST framework, for example, gives you many options, both built-in, as well as popular third-party extensions. Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To un

Re: selectively requiring login

2016-08-01 Thread Michal Petrucha
niffing proxy or some other tool, and just making the request directly? Cheers, Michal -- 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+unsubs

Re: Better style: from django.db import models vs from django.db.models import ...

2016-08-01 Thread Michal Petrucha
efault formfield; in that case, you'd need to have both model fields and form fields in the same module, and it would be quite chaotic and unclear which one you're referring to if you cherry-picked classes to import instead of just importing the modules. Cheers, Michal -- You receive

Re: django 1.9, migrations certainly don't suck

2016-07-29 Thread Michal Petrucha
On Fri, Jul 29, 2016 at 08:01:05AM -0700, Jorge Cadena wrote: > > > Traceback (most recent call last): > File "manage.py", line 10, in > execute_from_command_line(sys.argv) > File > "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", > line 353, in

Re: django 1.9, migrations SUCK

2016-07-29 Thread Michal Petrucha
ould get the exact same error even with the old syncdb. However, it is hard to tell for sure, since you have not provided the full traceback. Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

  1   2   3   >