Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django rest framework : custom object permissions doesn't work
My problem is very simple : I'm trying to create some custom permissions for my django rest API. This is my code (permission.py) : class UserPermissions(permissions.BasePermission): def has_object_permission(self, request, view, obj): return obj == request.user I just want that the users can only get, delete and update their own account. The problem is that I think my code is not read by Django. I have try to always return false (without any condition) and it does nothing. I have also try to print some debug message at the beginning of the file and it's does nothing. (My file permissions.py is at the root of my application) -
ImportError: cannot import name 'ParamSpec' from 'typing_extensions' when using Django websockets with channels and twisted libraries
We did not update any lib or new lib added. During deployment of Django web application, got the following error: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/celery/fixups/django.py", line 118, in django_setup django.setup() File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 116, in create mod = import_module(mod_path) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.7/site-packages/channels/apps.py", line 4, in <module> import daphne.server File "/usr/local/lib/python3.7/site-packages/daphne/server.py", line 5, in <module> from twisted.internet import asyncioreactor # isort:skip File "/usr/local/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py", line 19, in <module> from twisted.internet.posixbase import ( File "/usr/local/lib/python3.7/site-packages/twisted/internet/posixbase.py", line 16, in <module> from twisted.internet import error, tcp, udp File "/usr/local/lib/python3.7/site-packages/twisted/internet/tcp.py", line 99, in <module> from twisted.internet import abstract, address, base, error, fdesc, main File "/usr/local/lib/python3.7/site-packages/twisted/internet/base.py", line 34, in <module> from twisted.internet import abstract, defer, error, fdesc, main, threads File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 42, in <module> from typing_extensions import Literal, ParamSpec, Protocol ImportError: cannot import name 'ParamSpec' from 'typing_extensions' … -
Django rest framework send form data
I have to build a form page with multiple image uploads using CRUD functions that I made. On submit the page should not reload so I'm using ajax to make the request. The serializer keeps throwing an error 400 (Bad request). It might be that FormData stringify some values that shouldn't, bud serializer won't let me add an item. Please help, I'm second day on googling different aproaches to do it and none of them worked. views.py @api_view(['GET']) def index(request): imageform = ImageForm() form = CreateShopItemForm() return render(request, 'main/index.html', {"form": form, "imageform": imageform}) @api_view(['POST']) def create_item(request): shop_item = ShopItemSerializer(data=request.data) print(request.data) if shop_item.is_valid(raise_exception=True): shop_item.save() print('success') return Response(shop_item.data) else: print("invalid") return Response(status=status.HTTP_404_NOT_FOUND) models.py class ShopItems(models.Model): item_name = models.CharField(max_length=100, null=False, blank=False) item_price = models.FloatField(null=False) item_author = models.CharField(max_length=100, null=False, blank=False) date = models.DateField(auto_now_add=True, editable=False) class Image(models.Model): shop_item = models.ForeignKey(ShopItems, on_delete=models.CASCADE, related_name="images") image = models.ImageField() serializers.py class ImageSerializer(serializers.ModelSerializer): class Meta: model = Image fields = ['image',] class ShopItemSerializer(serializers.ModelSerializer): images = ImageSerializer(many=True) def create(self, validated_data): images_data = validated_data.pop("images") shop_item = ShopItems.objects.create(validated_data) for image_data in images_data: Image.objects.create(shop_item=shop_item, song=image_data) return shop_item class Meta: model = ShopItems fields = [ 'item_name', 'item_price', 'item_author', 'date', 'images', ] script.js $("#addItemForm").on("submit", function (e) { e.preventDefault(); let data = new FormData($(this)[0]); $.ajax({ url: … -
How properly use mptt?
There are model: class Employee(MPTTModel): name = models.CharField(max_length=100) position_name = models.CharField(max_length=100) position_lvl = models.IntegerField(null=True) hired_at = models.DateField(auto_now=True) salary = models.DecimalField(max_digits = 9, decimal_places= 2) parent = TreeForeignKey('self', null=True,blank=True, on_delete=models.CASCADE, related_name='subordinate') class MPTTMeta: order_insertion_by = ['position_lvl'] There are the view: def show_employees(request): return render(request, "employees.html",{'employees': Employee.objects.all()}) There are template: {% load mptt_tags %} <ul> {% recursetree employees %} <li> <{{ node.id }}>{{ node.name }} - {{ node.position_name }} ({{ node.position_lvl }}) {% if not node.is_leaf_node %} <ul class="children"> {{ children }} </ul> {% endif %} </li> {% endrecursetree %} </ul> I want to show employees by their position lvl (boss of the bosses have lvl 0, employee of the boss have 2 and etc.) But when i use this model and template i have not the correct image: <6>Имя манагера - манагер (2) <2>Дон Симон - Старший манагер (1) <1>Влад Савельев - Самый старший (0) <3>Генадий Горин - манагер (2) <4>Вася Пупкин - Старший разраб (1) <5>Виндовс Убунтович - разраб (2) The tempalte goes: Name - postion_name (position_lvl) And i want see all employees with the lvl 2, then their bosses with lbl 1 and the the boss of all bosses with lvl 0. How can i make it the right … -
Remove field from drf-api-tracking for Django Rest Framework
I'm using drf-api-tracking to track requests to an api build with Django Rest Framework. With time, the size of the resulting table is growing too big, and I don't need the information stored in the column that takes up the most space ("response", which contains the full JSON response data). Is there a way to systematically avoid storing this information? In the documentation I found instructions on how to avoid logging at all in certain cases, but not on how to skip individual columns. -
How to pass data (specific fiiled) from views.py to models.py
I have a problem. How can i pass the data (def maybe) from models.py I need this for filter by category in future def get_category(self): return self.category To views.py. This sample it doesn't work class GetDetailTag(DetailView): model = Tag template_name = 'main/catalog.html' context_object_name = 'tag' category = Tag.get_category def get_context_data(self, *, object_list=None, **kwargs): context = super().get_context_data(**kwargs,) context['pansion_in_tag_list'] = Pansions.objects.filter(tags__slug=self.kwargs['slug']) context['tags_in_category'] = Tag.objects.filter(category__slug = '...INSERT THE DATA FROM MODEL HERE...') return context I was trying to call the 'def'(get_category) in views.py Anyway? How i can to do that? -
How to correctly perform async django task execution
I am trying to make it so that a User is able to click Download on a web page to download about 30 reports from a third party API. Obviously, this takes time. So I am planning on implementing a WebSocket-based webpage that displays the status of that particular download (even if they reload the page) using Celery, Redis and Django Channels and Postgres. If a user wishes to download multiple reports at once, each download will be placed in a Queue. I know how to create tasks and use Django Channels, I’m just wondering if there is a standard way to manage task status in the database, so no matter what happens - the download on the front-end isn’t always saying ‘processing’ forever if it has failed for example. Is there a correct way to store the status of the task in the database? What if the download (task) fails during execution, how does it get stored? Any help would be appreciated. I have created the front-end thus far and prepared for websocket execution. -
404 Error while serving files with django
I want to access logs easily on my app so I created a page for that, I click on a button and it download the log. But I get a 404 error when I try to do that, I've set static files and media files here are my settings STATIC_URL = 'static/' STATICFILES_DIRS = [ "frontend/static", ] MEDIA_URL = 'media/' MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media') LOG_URL = 'static/logs/' LOG_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static/logs') and here are my urls urlpatterns += static(settings.LOG_URL, document_root = settings.LOG_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) It works when I access /media/path/to/media.file, but not for /static/logs/path/to/logs.txt, it's the same configuration for both urls so I know I miss a point, but how could I fix it? Is it because I used static and not media? Thx a lot -
How Can I use Django Filter Backend url parameters fields for multible models connected via onetomany connection?
I have an master and masterDetail model given in below; class Master(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='%(class)s_user') create_date = models.DateTimeField(auto_now_add=True) company = models.ForeignKey(Company, on_delete=models.CASCADE, related_name='%(class)s_company') department = models.ForeignKey(Department, on_delete=models.CASCADE, related_name='%(class)s_department') is_active = models.BooleanField(default=True) class MasterDetail(models.Model): master = models.ForeignKey(Master, on_delete=models.CASCADE, related_name='%(class)s_master') user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='%(class)s_user') recordtypes = models.ForeignKey(RecordTypes, on_delete=models.CASCADE, related_name='%(class)s_recordtypes') create_date = models.DateTimeField(auto_now_add=True) I want to filter data using these two model fields at the same time using Django Filter Backend url parameters. The url has two model field parameters like; http://127.0.0.1:8003/api/master/detail/query/page/list?search=&pages=1&page_size=14&company_code=XXX&recordtypes=general -
Django Model filters method finder
I would like to know if there is any way to do dynamically regroup a model by all available columns. models.py class ProductionPlan(models.Model): status_choices = ( ('READY TO START', 'Ready To Start'), ('IN PROGRESS', 'In Progress'), ('PROGRESS STOPPED', 'Progress Stopped'), ('MAINTENANCE STOPPED', 'Maintenance Stopped'), ('QUALITY STOPPED', 'Quality Stopped'), ) id = models.CharField(max_length=15, primary_key=True) first_start_date = models.DateTimeField(null=True, blank=True, default=None) bills_of_material = models.ForeignKey(BillsOfMaterial, on_delete=models.CASCADE) quantity = models.IntegerField() scheduled_date = models.DateTimeField() real_duration = models.DurationField() expected_duration = models.DurationField(default=None) start_date = models.DateTimeField(default=None, null=True) status = models.CharField(max_length=50, default='Ready To Start', choices=status_choices) now if i want to filter model i would use ProductionPlan.objects.filter(status__icontains = '') Then my question is this method of searching status__icontains or any other (start_date_contains, expected_duration__startswith) how can i get these methods. my end point is something like this: def get_methods_for_filter(model): do something here return ((**start_date_contains**, **expected_duration__startswith**) -
Django Override the Default success_url in contrib.auth.views
I made an app with app_name = 'accounts' in urls.py of the django and created signup/login pages there using the built-in signup function. Now I need to change all the class details of the success_url, for instance from: reverse_lazy('login') to: reverse_lazy('accounts:login') but overwriting the original urls.py is not a good practice. I'm a python beginner and struggling with this problem already for a month.. how can I achieve this? What I attemptd was making subclasses in my views inherent from each of the class in django.contrib.auth.views. I even tried putting try/except method with except 'NoReverseMatch:' but the function itself did not exist. -
Does django-cachalot lib support Django version 4.0?
Currently, the new django.core.cache.backends.redis.RedisCache cache backend provides built-in support for caching with Redis and I used it in my application. I've used the latest version django-cachalot and get this warning: Cache backend 'django.core.cache.backends.redis.RedisCache' is not supported by django-cachalot. It's so weird! Please help me to clear my question. I'm using Python 3.9, and MySQL 5.7. I applied the latest version of django-cachalot into Django app version 4.0.8, but get this warning: Cache backend 'django.core.cache.backends.redis.RedisCache' is not supported by django-cachalot -
How to confirm from user if he wants to leave the page while filling form?
I am creating a form where user can fill data. Based upon the user's input and selected options I'm showing the next data to fill using js which works totally fine. Now what I want is if the user presses the back or exit button accidentally. I want to confirm with the user if he really wants to exit from the current page. -
How to write an image attribute file in django (The 'image' attribute has no file associated with it)
I am building a django blog website and I am trying to upload an image on the website. I can access the photos on the admin page but whenever I try to access it on the page I get an enroll. The trace back says " The 'image' attribute has no file associated with it. This my code for the model class article(models.Model): title = models.CharField(max_length=200) author = models.ForeignKey(User, on_delete=models.CASCADE) content = models.TextField() image = models.ImageField(null=True, blank=True, upload_to='static/media/article') date = models.DateTimeField(default=timezone.now) def __str__ (self): return self.title def get_absolute_url(self): return reverse('article-detail', kwargs= {'pk':self.pk}) This is my views code class ArticleCreateView(LoginRequiredMixin, CreateView): model = article fields= ['title', 'content', 'image'] def ArticleCreateView(request): if request.method == "POST": form = ArticleForm(request.POST, request.FILES) if form.is_valid(): article = form.save(commit=False) article.author = request.user.id article.save() return HttpResponse this is the blog template code {% extends "agri_tourism/base.html" %} {% load crispy_forms_tags %} {% block content %} <section class="flex-container"> <div> {% for article in articles %} <article class="media content-section"> {% load static %} <div class="media-body"> <div style="text-decoration:none; display: inline-block;" class="article-metadata"> <img class="rounded-circle article-img" src="{{user.profile.image.url}}"> <a style="text-decoration:none;" class="mr-2" href="#">{{ article.author }}</a> <small class="article-date">{{ article.date|date:"F d, Y" }}</small> </div> <h2><a class="article-title" href="">{{ article.title }}</a></h2> <p class="article-content">{{ article.content }}</p> <img class="image-content" id="image-el" src = … -
Gunicorn ModuleNotFound : No module named 'core' when Deployment Django
I try to deployment my apps. So when i try to run this command gunicorn -c conf/gunicorn_config.py core.wsgi Error : ModuleNotFound : No module named 'core' This is my directory home/uletin --- conf --------- ... --------- gunicorn_config.py --- env --- graduates ------... ------core ------------ ... ------------ settings.py ------------ wsgi.py ------------ ... ------manage.py ------static in gunicorn_config.py like this command = '/home/uletin/env/bin/gunicorn' pythonpath = 'home/uletin/graduates' bind = '165.22.98.56:8000' workers = 3 -
AttributeError: 'dict' object has no attribute 'id'
I'm trying to access the dictonary inside the jsonfield serializer "assigned_facilities". But i'm receiving the following error: AttributeError: 'dict' object has no attribute 'facility_id' I'm basically trying to create a "LeadFacilityAssign" object for each item inside my json so i can have a "LeadFacilityAssign" object for each facility i want to add to a lead. json { "facilities": [{ "facility_id": "1", "datetime": "2018-12-19 09:26:03.478039" }, { "facility_id": "1", "datetime": "2018-12-19 09:26:03.478039" } ] } serializers.py class LeadUpdateSerializer(serializers.ModelSerializer): is_owner = serializers.SerializerMethodField() assigned_facilities = serializers.JSONField(required=False, allow_null=True, write_only=True) class Meta: model = Lead fields = ( "id", "first_name", "last_name", "PrimaryAddress", "City", "PostalCode", "RegionOrState", "pc_email", "Cell", "secphone", "client_cell", "client_secphone", "birthday", "curr_client_address", "curr_client_city", "curr_client_zip", "ideal_address", "ideal_city", "ideal_zip", "ideal_state", "budget", "client_email", "client_first_name", "client_last_name", "lead_status", "created_at", "agent", "is_owner", "relationship", "marital_status", "gender", "pets", "assigned_facilities", ) read_only_fields = ("id", "created_at", "agent", "is_owner") def get_is_owner(self, obj): user = self.context["request"].user return obj.agent == user def create(self, validated_data): assigned_facilities = validated_data.pop("assigned_facilities") instance = Lead.objects.create(**validated_data) for facilities in assigned_facilities: instance.leadfacility.create(assigned_facilities_id=assigned_facilities.facility_id,datetime=assigned_facilities.datetime) return instance models.py class Facility(models.Model): name = models.CharField(max_length=150, null=True, blank=False) def __str__(self): return self.name class Lead(models.Model): first_name = models.CharField(max_length=40, null=True, blank=True) last_name = models.CharField(max_length=40, null=True, blank=True) def __str__(self): return f"{self.first_name} {self.last_name}" class LeadFacilityAssign(models.Model): assigned_facilities = models.ForeignKey(Facility, on_delete=models.CASCADE, related_name='leadfacility') lead = models.ForeignKey(Lead, on_delete=models.CASCADE, related_name='leadfacility') … -
How to add a XML file to postgreSQL table using python in Django
I have initially connected to postgreSQL in settings.py and added my app in the INSTALLED_APPS. Then I created my table in models.py models.py: class Activity(models.Model): date = models.DateField(default=None) time = models.TimeField(default=None) function = models.CharField(max_length=10, default = None) status = models.CharField(max_length=10,default=None, blank=True, null=True) logfilename = models.CharField(max_length=128) after that I migrated my table and the table was created in postgreSQL. currently I added the XML data to postgreSQL Table by adding a code in the command shell command shell code: from oapp.models import Activity import os import xml.etree.ElementTree as ET from xmldiff import main, formatting file_1 = 'sample.xml' def xmlparse(): data = ET.parse(file_1) root = data.findall("record") for i in root: date = i.find('date').text time = i.find('time').text function = i.find('function').text status = i.find('status').text logfilename = i.find('logfilename').text x = Activity.objects.create(date=date, time=time, function=function, status=status, logfilename=logfilename) x.save xmlparse() But I wanted to run it as a python code. When I run it as python code it shows module not found error. It only works in command shell. What I want is to run t as a python code. error when run as python: Traceback (most recent call last): File "c:\Users\ostin\Desktop\nohope\projectq\qapp\qcode.py", line 1, in <module> from qapp.models import newrecord ModuleNotFoundError: No module named 'qapp' -
Django Group By like in SQL
I have following model class Product(models.Model): name = models.CharField(max_length=20) class FAQ(models.Model): product = models.ForeignKey(Product, on_delete=models.PROTECT) title = models.CharField(max_length=500) description = models.TextField(max_length=2000) order = models.IntegerField(validators=[MinValueValidator(0)], default=0) column = models.IntegerField(validators=[MinValueValidator(0)], default=0) def __str__(self): return f'{self.product.name}->{self.title}->{self.column}' class Meta: ordering = ('column', 'order') I want to group all result where column is same i.e IF column have value 1 in my model all data is enclosed inside one list I tried looking for annotate but could not figure out how i use in my code expected response [ [## this have column value 1 { "product": 1, "title": "Test 1", "description": "Description 1", "order": 0, }, { "product": 1, "title": "Test 2", "description": "Description 2", "order": 1, } ], [ ## this have column value 2 { "product": 1, "title": "Test3", "description": "Description 3", "order": 0, }, { "product": 1, "title": "Test 4", "description": "Description 4", "order": 1, } ] ] Here is my overall code any class FAQView(APIView): def list(self, request): queryset = FAQ.objects.values('product', 'title', 'description', 'order').annotate("?") serializer = FAQSerializer(queryset, many=True) return Response(serializer.data) -
Access blocked: django-oauth’s request is invalid
Sign in with Google Access blocked: django-oauth's request is invalid a avinash.sharma@technogetic.com You can't sign in because django-oauth sent an invalid request. You can try again later, or contact the developer about this issue. Learn more about this error If you are a developer of django-oauth, see error details. Error 400: redirect_uri_mismatch i am trying to use google oauth(social-auth) in django.i followed these steps given in this link="https://www.section.io/engineering-education/django-google-oauth/" but keep getting this error in browser.please help -
`SynchronousOnlyOperation` error while trying to run Playwright automation triggered django admin action
This is the error: SynchronousOnlyOperation at /admin/app/modelA/ You cannot call this from an async context - use a thread or sync_to_async. What I'm trying to do is: I have an action in django-admin that intends to run an automated task with Playwright. The action in admin.py looks like this: @admin.action(description="Do task") def run_task(modeladmin, request, queryset): for obj in queryset: task = Task(obj) task.run() And the Task class looks like this: class Task: def __init__(self, task: Task) -> None: self.task = task def run(self): with sync_playwright() as p: browser = p.chromium.launch(headless=True) page = browser.new_page() page.go_to("www.google.com") # DO SOME STUFF browser.close() And when I run the action the error shows as soon as chromium gets ready. Thank you beforehand. I expect it to do the stuff without running at least get the title of the page. I tried using sync_to_async as these docs suggest, implemented it in two ways (which I believe are wrong) First way I tried: Is by trying to use sync async in the admin.py file when the function Task.run is called: @admin.action(description="Do task") def run_test(modeladmin, request, queryset): for obj in queryset: task = Task(obj) sync_to_async(task.run, thread_sensitive=True) It didn't work 2. Second way I tried: Is by adding the … -
what are the different ways to login and authenticate user (like using OAuth2 ,jwt ,okta ) in Django application
I want to know what are the different ways by which live applications built on Django framework Authenticate users while login. what all ways are used apart from Django inbuilt authentication for user login . I found all these tutorials using Django's inbuilt authentication from Django.contrib library. I want to know what methods are used in real world live Django applications. -
Django Q and reduce doesn`t work as expected
I'm newly in Django. Don't understand where I'm going wrong. When I use this code it will work as expected. def filter_qs(self, qs): if self.filter == {}: return qs else: q_objects = [models.Q()] if self.filter['vendor']: q_objects.append(Q(vendor__in=self.filter['vendor'])) if self.filter['start_date']: q_objects.append(Q(date__gte=self.filter['start_date'])) if self.filter['end_date']: q_objects.append(Q(date__lte=self.filter['end_date'])) if self.filter['product']: product_list = (Q(product_type__contains=product) for product in self.filter['product']) if product_list: q_objects.append(reduce(operator.or_, product_list)) if len(q_objects) > 1: qs = qs.filter(reduce(operator.and_, q_objects)) However, when I use the query filter, filter_query = Result.objects.filter( Q(vendor__in=vendor) if vendor else Q() & Q(date__gte=start_date) if start_date else Q() & Q(date__lte=end_date) if end_date else Q() & Q(reduce(operator.or_, (Q(product_type__contains=product) for product in products)))) this part of the query does not work in filter_query: Q(reduce(operator.or_, (Q(product_type__contains=product) for product in products))) I don't get a query filter per product. Don't understand where I'm going wrong. Look for the query to work properly. -
hello can I make several genlist on the same model with different forms [closed]
I create a model and i do a genlist,gencreate,genupdate .... and now i need another genlist on the same model. I do it but on the menu the first genlist is always affiched. What can i do to display the second genlist or the second forms on the edit mode. -
NoReverseMatch at /question/1 Reverse for 'upvote' with arguments '('',)' not found. 1 pattern(s) tried: ['answers/(?P<id>[0-9]+)/upvote\\Z']
Can some one help me,Iam trying to get a details view page and i got this error No reverse match.Im sharing my view page,urls, and models down here .please find a solution guys!!!! https://hastebin.com/ogogofawag.typescript i tried to change the url names and didnt get rid of that error the url link is ` <a href="{%url 'upvote' ans.id %}">upvote<span>{{ans.upvote.all.count}}</span></a> ` -
How to customise task context (process_data cards) in django-viewflow
What I want I'm building an approval workflow using django-viewflow and django-material. The individual tasks are rendered as a main form with context on a very narrow column on the right hand side. I want to change the layout so that the task context (the detail views of all involved model instances) is better readable to the user, and also customise which fields are shown (eg. exclude a user's password hash). Where I'm stuck Is there a way to override which data is available as process_data short of overriding viewflow's get_model_display_data and include_process_data? E.g. I'd like to have the related instance's __str__() as title. Does viewflow have any canonical way to provide individual detail card templates? My alternative would be to completely re-work the contents of the process_data sidebar using context['process'] as the central instance, but that would tie the templates to the data model. I'd be grateful on any pointers here. What I've tried I'm overriding/extending the viewflow templates. As per templatetag include_process_data, the template process_data.html supplies the column of model instance detail cards, fed by data from get_model_display_data. It's e.g. easy to override process_data.html to change the cards into a MaterializeCSS collapsible list: {% load i18n viewflow material_frontend …