Vicious cycle: Cannot migrate a DB that uses a widget using a model

2019-06-19 Thread Victor Porton
When I try to migrate my project from empty DB state, it falls into a vicious cycle: Trying to migrate it requests Country.objects.all() because it has form fields using PlaceWidget but this requires it to be already migrated. How to solve this problem? class PlaceWidget(widgets.MultiWidget):

How to migrate MySQL -> PostgreSQL?

2019-06-03 Thread Victor Porton
How to migrate a production database MySQL -> PostgreSQL? (MySQL has several bugs, I want to try something other on my production server.) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

How to report data migration error?

2019-05-23 Thread Victor Porton
Which exception should be raised if my data migration code finds that the data in the DB has a logical error and cannot be migrated for this reason? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Give advice on data migrations

2019-05-10 Thread Victor Porton
Give advice: After migrating data, should I remove old fields immediately or after I change the views and forms to use new models instead of old ones? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop recei

REST Framework alternatives

2019-02-05 Thread Victor Porton
My buddy says that REST Framework is complex and inflexible. So the question: Any other framework which supports validating JSON data? -- 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

Python package to accept payments in Internet

2017-05-02 Thread Victor Porton
I have created a full featured package to accept payments in Internet (currently supports PayPal). It has especially great support for recurring payments. Here it is: http://freesoft.portonvictor.org/django-debits.xml I hope we with community work will turn it into an universal payment gateway

Make a separate table for a model without additional fields

2017-05-01 Thread Victor Porton
I store into the DB payments received through PayPal. Every payment is either manual or automatic (automatic payments are done for the user by PayPal automatically, based on user's permission to pay in the future). I wish to distinguish manual and automatic payments in the DB. But in the follow

Check if all boolean values are the same (database)

2017-02-14 Thread Victor Porton
# May contain several purchases class Transaction(models.Model): name = models.CharField(null=True) class Purchase(models.Model): bundle = models.ForeignKey(Transaction, null=True) recurring = models.BooleanField(default=False) For a given transaction, all its purchases must either al

Add rows in migrations?

2016-10-04 Thread Victor Porton
After generating DB scheme, I need to add two rows with certain data to certain table. How to do it? Can it be handled with migrations? A complication is that these two rows contain strings dependent on the user's language. Can this be done? -- You received this message because you are subs

Re: Testing a reusable app which uses a database

2016-10-03 Thread Victor Porton
Well, I did it. On Monday, October 3, 2016 at 10:41:59 PM UTC+3, Victor Porton wrote: > > I try to make a reusable app which uses transaction.atomic(). > > When I run my test.py (below) for my reusable app, I get the below errors. > > Is it possible to test this reusable app o

Testing a reusable app which uses a database

2016-10-03 Thread Victor Porton
I try to make a reusable app which uses transaction.atomic(). When I run my test.py (below) for my reusable app, I get the below errors. Is it possible to test this reusable app outside of a Django project? [[[ import unittest from transaction_utils.transaction import retry class TestRetry(uni

An almost reusable app, how to make it reusable?

2016-10-03 Thread Victor Porton
I've created an app which is "almost" reusable: it depends on a variable in /setting.py of our project . from .settings import TRANSACTION_ATTEMPT_COUNT Can it be made into an reusable app? -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

How to detect deadlocks?

2016-10-03 Thread Victor Porton
How to detect deadlocks of a transaction? Which exception is thrown if a deadlock happens? We currently use SQLite and MySQL but may switch to another DB. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop