METAPROGRAMMING Telegram 57
Rails-разработчик, однажды наступив на грабли, знает, что в миграциях нельзя использовать код моделей. Модель может быть изменена или удалена, а миграция (в идеале) должна работать "с нуля" на свежей версии кода.

Django, будучи способным вычислить State, знает, какие поля у каких моделей в какой момент времени (на момент исполнения какой миграции) существовали. Поэтому внутри миграции вы, через специальный DSL, можете получить "призрак" класса своей модели на момент прохождения данной миграции: в ней будут все стандартные методы и ассоциации (но, конечно, все кастомные методы будут недоступны).

#programming #django



tgoop.com/metaprogramming/57
Create:
Last Update:

Rails-разработчик, однажды наступив на грабли, знает, что в миграциях нельзя использовать код моделей. Модель может быть изменена или удалена, а миграция (в идеале) должна работать "с нуля" на свежей версии кода.

Django, будучи способным вычислить State, знает, какие поля у каких моделей в какой момент времени (на момент исполнения какой миграции) существовали. Поэтому внутри миграции вы, через специальный DSL, можете получить "призрак" класса своей модели на момент прохождения данной миграции: в ней будут все стандартные методы и ассоциации (но, конечно, все кастомные методы будут недоступны).

#programming #django

BY Metaprogramming


Share with your friend now:
tgoop.com/metaprogramming/57

View MORE
Open in Telegram


Telegram News

Date: |

Click “Save” ; The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins. On Tuesday, some local media outlets included Sing Tao Daily cited sources as saying the Hong Kong government was considering restricting access to Telegram. Privacy Commissioner for Personal Data Ada Chung told to the Legislative Council on Monday that government officials, police and lawmakers remain the targets of “doxxing” despite a privacy law amendment last year that criminalised the malicious disclosure of personal information. The group’s featured image is of a Pepe frog yelling, often referred to as the “REEEEEEE” meme. Pepe the Frog was created back in 2005 by Matt Furie and has since become an internet symbol for meme culture and “degen” culture. On June 7, Perekopsky met with Brazilian President Jair Bolsonaro, an avid user of the platform. According to the firm's VP, the main subject of the meeting was "freedom of expression."
from us


Telegram Metaprogramming
FROM American