The option to make a model owned by a user is actually documented for the Django Admin app. However, for reference, here are the steps:
First, the model you want to have an owner needs to reference “User” as a foreign key: (in models.py)
submitted_by = models.ForeignKey(User, on_delete=models.CASCADE)
url = models.URLField()
Provided you want to use this model in Django-Admin, there is an explicit method the app provides when defining admin models: (in admin.py)
model = Website
list_display = ('url', )
exclude = ('submitted_by', )
def save_model(self, request, obj, form, change):
if not change:
# only add owner if not changed object
obj.owner = request.user
super().save_model(request, obj, form, change)
A heads-up: Django documentation is explicit that both save_model and delete_model have to call the corresponding super()-method in order to actually save the modified model. Reasoning here is these methods are meant to interact with the process and add extra steps, they are not meant to veto.
Additional thoughts: For a model having an owner is really convenient in plenty of situations, in particular when managing permission. The field can e.g. be matched when viewing details of an object.
There are other, potentially more flexible approaches to the problem. In particular when solving in custom views, the field has to be set manually. The same is true when using more complete solutions like “django-guardian”.
Part of the compelling nature of SaaS Products is the possibility to understand the user and improve on the go. Any Product Manager will literally have to understand what are the use-cases for customers and how to focus on the important areas. Just recently our team led the debate which metrics would be the right ones to focus on.
Nancy Wang, Head of Product Management at Amazon Web Services, highlights six product metrics enterprise SaaS companies should track.
In this Article, Nancy Wang, head of Product Management at the most successful cloud service providers, shares her insights on important metrics to keep an eye on. The possibility to understand often goes overboard and requires focus.
The case under discussion in the article revolves around paid products. Derived metrics are a foundation that serves as a blueprint to other products in the SaaS space. Goals differ, but ultimately, to make a product successful, it requires an understanding of how successful customers were, using the product. Following the established funnel pattern, users are being segmented into funnel. Along that funnel, the metrics acquired need to reflect the stage of the journey the user is on.
At the top of the funnel, most often the interaction is anonymous and requires profiling to understand the audience coming in. Further down in the funnel, metrics capture engagement and transaction. Towards the end of the funnel, the metric needs to relate to retention.
Already on Friday, Fastly, one of the more prominent representatives of the Website acceleration technology business, went public. Despite two days old, still worth mentioning. The San Francisco based company can be found under the label NASDAQ: FSLY. Measured by the initially offered price of 16$/share, the first day of trading close at $24.20 can be considered a successful IPO.
Today, we listed on the New York Stock Exchange, marking our first day of trading as a public company.
Box-256 is a browser game
where you need to solve
small tasks, e.g. let a program draw a square, in your browser. Through writing assebly. Since I wrote quite a bit assembly throughout my career, I thought this is interesting. Still, I failed at level one. Mostly because of impatience.
Microsoft announced it will be open sourcing Visual Studio Code at it’s connect(); developer conference. Code is available over at github. Alongside, MSFT released a preview extension that will allow debugging Linux applications using GDB, too.
Microsoft doubles down on cross-platform software development.
Nachdem die view-decorators seit der Einführung von Class Based Generic Views nicht mehr funktionieren ist ein Ersatz oft gebraucht. brack3t/django-braces fasst die gängigen Funktionen, wie beispielsweise LoginRequired oder PermissionRequired, sinnvoll zusammen.