Questions tagged [ORM] (308)

1
answer

How to properly and safely use the ORM in Yii 2?

Hello. The background Who knows what ORM, and especially, who used it, and know that this thing is very comfortable. I was looking for, is there any ORM in Yii 2, and found there the Doctrine - ( installed with Yii ) and class Migration You say, open a console and type yii migrate and you will have happiness. Yes! When you...
madilyn.Bo asked April 18th 20 at 13:04
3
answers

It is bad to use ORM?

Hello, in the database I don't know much, but studied here in depth Django ORM and wonder. And it is bad to use an ORM and avoid writing direct requests? I will say more on a project where we had to write queries to MySql, I also did a little ORM on the knee, to make it easier and faster to work with. Are there any fat obj...
Domenick17 asked April 16th 20 at 10:43
2
answers

RedBeanPHP or PDO?

Hello! This question has been asked here more than once, but all the same, no normal response is not given. Someone insists that PDO is better and someone on the contrary, so the question arises - what is better for maximum safe interaction with the database? Or even use a different ORM?
Lorenzo63 asked April 8th 20 at 17:58
2
answers

Is there a difference where to specify all()?

The crux of the matter: is there a difference between Entry.objects.all().filter(pub_date__year=2006) and Entry.objects.filter(pub_date__year=2006).all()
Burnice.Adams asked April 8th 20 at 17:14
2
answers

Django. How to get records which have no booking for a specified period?

Ay NID yo help! Have a model Booking with fields: #Model Booking from_date = models.DateTimeField() #date of booking to_date = models.DateTimeField() #date end of reservation vehicle = models.ForeignKey(Vehicle .... # FK to the car model confirmed = models.BooleanField(default=False) #Podverzhdennyh or not So I can not und...
Javonte.Gaylord73 asked April 8th 20 at 01:56
1
answer

How to create file field, the entity?

I have the essence of one of the fields which should be a file. Well, suppose this: class MessageTable extends \Bitrix\Main\Entity\DataManager { public static function getMap() { return array( new Entity\IntegerField('ID', array( 'primary' => true, 'autocomplete' => true )), new Entity\IntegerField('AUTHOR', a...
Franz.Heaney asked April 7th 20 at 15:38
1
answer

How to model objects after grouping the Django ORM?

I need to group the directories by name, and from each group to choose the directory with the latest version. Do this: Handbook.objects.values('name').annotate(latest_version=Max('version')) Model class Handbook(models.Model): name = models.CharField(max_length=128) short_name = models.CharField(max_length=32) descriptio...
madeline4 asked April 7th 20 at 10:49
1
answer

How to select 3 users with the greatest balance peewee?

Hi all, please tell me how from SQlite databases using peewee to bring top 3 players on the balance sheet. I have in the database there are many players I need to display the 3 players with the highest balance reduction balance
Emmanuelle42 asked April 7th 20 at 08:59
2
answers

Do I have to laravale to use Eloquent ORM?

I don't have much experience with laravale and I wanted to ask - is it necessary in General to use the model Eloquent ORM or you can just write your own and to work with the database use the DB facade? It's just that these models are of course convenient, but most of my needs, from sample data, they do not close, as I need ...
sunny_Marks asked April 4th 20 at 12:58
0
answer

How to make annotation in the set of field values in Django ORM?

Have a simple model of the form:Date = models.DateField() Parameter = models.TextField() Amount = models.BigIntegerField() It is necessary to obtain a sample of the form [DATE | AMOUNTAmountдляРагам1 | AMOUNTAmountдляРагам2 .... etc.] For option without parameter (the amount per day, roughly) done like this:response = model...
luther.Volkm asked April 4th 20 at 12:40