Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Dependent/Chained Dropdown List with Django not see the 'gruppo_single' in self.data
I have a problem with a select that filters the other. I did all the filtering correctly from the frontend point of view but in the backend I can not save the data. This is the error: select a valid choise. That choice is not one of the available choices. I think the problem is in the fact of the form as it does not find 'group_single' that I pass through post in my views. view esercizi_instance.gruppo_single = get_object_or_404(DatiGruppi, gruppi_scheda = scheda.id, dati_gruppo = gruppoName) form if 'gruppo_single' in self.data: models.py class Gruppi(models.Model): nome_gruppo = models.CharField(max_length=100) class Esercizi(models.Model): nome_esercizio = models.CharField(max_length=100) gruppo = models.ForeignKey( Gruppi, on_delete = models.CASCADE, related_name = 'gruppo' ) class Schede(models.Model): nome_scheda = models.CharField(max_length=100) data_inizio = models.DateField() data_fine = models.DateField() utente = models.ForeignKey( User, on_delete = models.CASCADE, related_name = 'utente' ) class DatiGruppi(models.Model): giorni_settimana_scelta = [ ("LUNEDI","Lunedì"), ("MARTEDI","Martedì"), ("MERCOLEDI","Mercoledì"), ("GIOVEDI","Giovedì"), ("VENERDI","Venerdì"), ("SABATO","Sabato"), ("DOMENICA","Domenica") ] giorni_settimana = MultiSelectField( choices = giorni_settimana_scelta, default = '-' ) dati_gruppo = models.ForeignKey( Gruppi, on_delete = models.CASCADE, related_name = 'dati_gruppo' ) gruppi_scheda = models.ForeignKey( Schede, on_delete = models.CASCADE, related_name = 'gruppi_scheda' ) class DatiEsercizi(models.Model): serie = models.IntegerField() ripetizione = models.IntegerField() peso = models.DecimalField( max_digits = 4, decimal_places = 1, blank = True, null … -
What is "Type Error: can't pickle weakref objects"
I am trying to pickle.dump() an object with a model property that stores a Keras and TensorFlow model. admin.py def build(self, request, queryset): count = 0 for p in queryset: if build_id(p.project_management.id): count += 1 else: messages.warning(request, f"Could not build model for {p}") messages.success( request, f"Successfully built models for {count} projects") build.short_description = "Build models for selected Projects" build.py def build_id(project_id): # get directory path to store models in path = fetch_model_path(project_id, True) # train model model, scaler_in, scaler_out = train_project_models(project_id) # ensure model was trained if model is None: return False # store models store_model(f'{path}/model.pkl', model) store_model(f'{path}/scaler_in.pkl', scaler_in) store_model(f'{path}/scaler_out.pkl', scaler_out) # clear current loaded model from memory keras_clear() return True utils.py # dump model to path def store_model(path, model): with open(path, 'wb') as f: model_file = File(f) pickle.dump(model, model_file) when I Build my model then I found this error. I am using the python Django project. When I Build model this show an internal server error too as shown in picture -
ModelForm fills foreign key field as a number
I have model from which I created a ModelForm: models.py: class City(models.Model): name = models.CharField(max_length=50) def __str__(self): return f'{self.name}' class Profile(models.Profile): name = models.CharField(max_length=50) user = models.OneToOneField(User, on_delete=models.CASCADE, unique=False) location = models.ForeignKey('City', on_delete=models.SET_NULL, blank=True, null=True) forms.py from django import forms from .models import Profile, City class LocationField(forms.CharField): def clean(self, value): try: city = City.objects.get(name=value) except ObjectDoesNotExist: city = City.objects.create(name=value) return city class ProfileForm(forms.ModelForm): location = LocationField() class Meta: model = Profile exclude = ['user'] views.py def profile_update_view(request): template_name = 'profiles/update.html' user = request.user profile = Profile.objects.get(user__id=user.id) if request.method == 'GET': form = ProfileForm(instance=profile) else: form = ProfileForm(request.POST, instance=profile) if form.is_valid(): obj = form.save(commit=False) obj.user = user obj.save() return redirect('profile_view') context = {'form': form} return render(request, template_name, context=context) When I'm saving form, I'm satisfied how it's working, but when I load form again to update in, it fills LocationField() as an City pk integer, but I want it to load name instead. Is there a way to do this? -
Fill forms.MultipleChoiceField with list instead model
Well, I've started with django and I want to extract the categories of a wordpress blog and expose them in a multiple selector. Here is what i do: Forms.py from django import forms from django.conf import settings from wordpress_xmlrpc import Client from wordpress_xmlrpc.methods import taxonomies def categoryList(): wp = Client(settings.WP_URL, settings.WP_USER, settings.WP_PASSWORD) categories = wp.call(taxonomies.GetTerms('category')) return categories class WPCategoriesForm(forms.Form): wpCategories = forms.MultipleChoiceField(label="Select your category",choices=categoryList(), widget=forms.Select(attrs={'class':'form-control selectpicker show-tick'})) views.py def get_categories(request): ''' Bring categories from wordpress ''' context ={} context['WPform']= WPCategoriesForm() return render(request, 'page_1.html', context) But i'm a little lost with templates, Here is what i coded: Page_1.html <div class="col-md-6"> <form class="form-inline" method="POST"> <select name="wpCategories" class="form-control page-section selectpicker show-tick" id="WpCategories"> <option value="" selected>Select Wordpress category</option> {{ form.wpCategories }} </select> </form> </div> Sorry but i'm pretty new with django and i don't know why de multiple choice is not filled, can you help me? -
I get this Error AttributeError at /listings/5689-resot-relly-market, 'Profile' object has no attribute 'favourite' please any help would be apprciate
I'm working a add to favourite function in django and i keep getting this error when i hit the save button, everything looks fine from here that why i can't really tell where the error is coming from and i'm stuck with this project now. It kinda urgent please any help would be really appreciated and honoured. Models.py from basefunc.models import Accomodation class Profile(models.Model): user = models.OneToOneField(User, related_name='profile', on_delete=models.CASCADE) usertitle = models.CharField(max_length=1000, null=True, blank=True) city = models.CharField(max_length=1000, null=True, blank=True) state = models.CharField(max_length=1000, null=True, blank=True) address = models.CharField(max_length=10000, null=True, blank=True) about = models.TextField(max_length=10000, null=True, blank=True) about = models.TextField(max_length=10000, null=True, blank=True) facebook = models.URLField(max_length=10000, null=True, blank=True) twitter = models.URLField(max_length=10000, null=True, blank=True) instagram = models.URLField(max_length=10000, null=True, blank=True) other = models.URLField(max_length=10000, null=True, blank=True) phone = models.IntegerField(null=True, blank=True) zipcode = models.IntegerField(null=True, blank=True) image = models.ImageField(default='default.jpg', upload_to="profile_pic") favorite = models.ManyToManyField(Accomodation, related_name='profile') views.py from userauth.models import Profile def AccomodationDetails(request, accomodation_slug): accomodations = get_object_or_404(Accomodation, slug=accomodation_slug) accomodations_list = Accomodation.objects.filter(status="publish").order_by("-publication_date") images = Images.objects.all() categories = Category.objects.all() features = Features.objects.all() amenities = Amenities.objects.all() advanced_features = Advanced_Features.objects.all() user = request.user.id profile = Profile.objects.get(user__id=user) if request.method == "POST": if profile.favourite.filter(slug=accomodation_slug).exists(): profile.favorite.remove(accomodations) else: profile.favorite.add(accomodations) context = { 'accomodations': accomodations, 'accomodations_list': accomodations_list, 'categories': categories, 'features': features, 'advanced_features': advanced_features, 'amenities': amenities, 'images': images, } return render(request, … -
how to query from multiple models in django
I am trying to understand the most efficient way to query the data needed from multiple tables in Django. class City(): name = models.CharlField() class Address(): line1 = models.CharlField() ... city_id = models.ForeignKey(City ... related_name="city_address") class Student() name = models.CharlField() gender = models.CharlField() # a student can only have one address address_id = models.OneToOneField(Address ... related_name="address_student") How can I optimize the query below to get the city this student belongs to? student = User.objects.filter(name="John").first() # assuming its a unique name address_id = student.address_id address = Address.objects.filter(id=address).first() city_id = address.city_id City.objects.get(id=city_id) Thank you in advance. -
Server Error 500 when Debug = False in django
I've keep getting Server Error (500) when I let the DEBUG = False I cant find the solution -
How to validate a field with uppercase with django serializers
I am programming an API and I have noticed the following error when debugging. The following code does not validate the Status field class DocumentSalesforceSerializer(serializers.Serializer): AccountId = serializers.CharField(required=True) ContactId = serializers.CharField(required=True) Status = serializers.CharField(required=True) StartDate = serializers.CharField(required=True) EndDate = serializers.CharField(required=True, allow_blank=True) Subject = serializers.CharField(required=True) def validate_status(self, Status): if Status not in ("New", "In Progress", "On Hold", "Completed", "Closed", "Cannot Complete", "Canceled"): raise serializers.ValidationError("Invalid Status") return Status But, when I change the word "Status" to "status" like this: class DocumentSalesforceSerializer(serializers.Serializer): AccountId = serializers.CharField(required=True) ContactId = serializers.CharField(required=True) status = serializers.CharField(required=True) StartDate = serializers.CharField(required=True) EndDate = serializers.CharField(required=True, allow_blank=True) Subject = serializers.CharField(required=True) def validate_status(self, status): if status not in ("New", "In Progress", "On Hold", "Completed", "Closed", "Cannot Complete", "Canceled"): raise serializers.ValidationError("Invalid Status") return status Everything is working perfectly fine. Can anyone tell me why is it working like that and how can I do to validate the "Status" uppercase field? Thanks -
Django charts.js of database column?
I have a model database in this format sno Date Premium Count Time Date_time Close None Oct. 13, 2021 None 2 2:22 p.m. 38735 None Oct. 13, 2021 None 2 2:23 p.m. 38727 None Oct. 13, 2021 None 2 2:24 p.m. 38739 None Oct. 13, 2021 None 2 2:25 p.m. 38750 None Oct. 13, 2021 None 2 2:26 p.m. 38730 None Oct. 13, 2021 None 2 2:27 p.m. 38723 I want to make a simple bar chart of 'Close' column in the database. I have tried using some manual random values in chart.js code which I have done successfully, but how do I take the database field 'Close' , converting it into a list and plot a chart from it? -
Assign user to a single group LDAP Django Netbox
I have a single group in Netbox admin page. I am trying to assign users to that specific group when the user logs in for the first time. I managed to assign the user to the group I wanted by using: AUTH_LDAP_MIRROR_GROUPS = "true" This also created all other groups which user belongs to and I want to avoid that. Is there a way to mirror only a single group, or should I approach this without mirroring? My current idea is to use: AUTH_LDAP_MIRROR_GROUPS_EXCEPT = [listOfAllOtherUsersGroupsExceptTheSpecificOne] I was not able to find how to get the list of users groups and then return list without a specific group. -
Custom button classes in django crispy forms
The technical issue of styling buttons in django crispy forms. I would like to apply my own class, without using the primary button class. class MyForm(Form): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fields("field_1"), Fields("field_2"), Submit('submit', u'On', css_class='own-css-class'), ) Basically, I solved this by adding self.helper.form_tag = False and inserting the button code directly into the html template. In addition, I deleted the submit button from the layout. class MyForm(Form): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fields("field_1"), Fields("field_2"), ) self.helper.form_tag = False Is this solution correct and will it be compatible in the long term? -
How to read an dictionary object from Django form?
I have 2 models in Django, one is the Todo model, another is the Team model, the Todo model has a foreign key from Team, but the team is return its value as a dictionary, so my question is how can I get value from the dictionary in Todo.form. The dictionary is a must-have for another app, so I wonder is it possible to return a dictionary and a self.name together? Now I can only see text like 'team object(1)' on the list, it would be great if anyone happen to know what can I do about this, cheers. models.py ''' class Team(models.Model): name = models.CharField(max_length=20) employeeID = models.CharField(max_length=20) email = models.CharField(max_length=50) position = models.CharField(max_length=50) password = models.CharField(max_length=20) projects = models.ForeignKey(Project, on_delete=models.CASCADE) def toDict(self): return{'id':self.id, 'employeeID':self.employeeID, 'name':self.name, 'email':self.email, 'position':self.position, 'password':self.password} class Todo(models.Model): status_option = ( ('to_do', 'to_do'), ('in_progress', 'in_progress'), ('done', 'done'), ) status = models.CharField(max_length=20, choices=status_option, default='to_do') # todo_list's content team = models.ForeignKey('Team', on_delete=models.CASCADE) project = models.ForeignKey(Project, on_delete=models.CASCADE) name = models.CharField(max_length=20) create_date = models.DateTimeField(auto_now_add=True) start_date = models.DateTimeField(default=datetime.datetime.now) due_date = models.DateTimeField(default=datetime.datetime.now) priority_level = models.IntegerField(default=1) project_code = models.CharField(max_length=20) details = models.TextField() def __str__(self): return self.details[:20]+"..." # return self.team['team'].queryset def update_status(self): if self.status == 'to_do': self.status = 'in_progress' elif self.status == 'in_progress': self.status … -
How to show the user the posts (or movies) in this case they have liked?
I have a user profile page where I want to show the user the movies they have liked. Here is the part of model which contains the like field as an ManyToManyField. class moviefiles(models.Model): name = models.CharField(max_length=50) duration = models.CharField(max_length=20) . . . liked = models.ManyToManyField(User, related_name='movie_like') rt = models.IntegerField(default=1) Here is the def in view for liking or unliking: def movieLike(request, slug): user = request.user if user.is_authenticated: post = get_object_or_404(moviefiles, slug=request.POST.get('post_id')) liked = False if post.liked.filter(id=request.user.id).exists(): post.liked.remove(request.user) liked = False return HttpResponseRedirect(reverse('movie-about', args=[str(slug)])) else: post.liked.add(request.user) liked = True return HttpResponseRedirect(reverse('movie-about', args=[str(slug)])) else: return redirect('/user/signup') I am using MongoDB as the database and django made two tables in it on running makemigrations, one is the home_moviefiles and another is home_moviefiles_liked which is storing the liked data and the data of liking or unliking is getting saved correctly. I'm trying to retrieve the the movies which a user has liked but I am unable to proceed from here. -
Display information about linked models fields in the django admin
These are my models: class Partner(models.Model): name = models.CharField(max_length=200, verbose_name="Organisation name") class ResearchActivity(models.Model): title = models.CharField(max_length=200) partner = models.ManyToManyField(ActivityPartner, blank=True) I'd like, in the Django administration forms, to have a field in my Partner edit form representing the ResearchActivity linked to that Partner. Can this be achieved by adding a field to my Partner model (say, naming it linked_partner) and then edit my admin.py like so: @admin.register(ActivityPartner) class ActivityPartnerAdmin(admin.ModelAdmin): search_fields = ['academic',] autocomplete_fields = ['partnership_type', 'relationship_type', 'academic_links'] def get_changeform_initial_data(self, request): return {'live_contract': ResearchActivity.objects.all().filter(linked_partner__id=request.ResearchActivity.partner.id)} ? -
Django: How can I change the design of a foreign key when using forms.py?
This is my patient model and forms: class Patient(models.Model): def __str__(self): return f"{self.first_name} {self.last_name}" doctor = models.ForeignKey(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) sex = models.CharField(max_length=20) phone = models.IntegerField() birth_date = models.DateField() class PatientForm(forms.ModelForm): BIRTH_YEAR_CHOICES = [] for years in range(1900,2021): BIRTH_YEAR_CHOICES.append(str(years)) sex_choice = [('1', 'Homme'), ('2', 'Femme')] sex = forms.ChoiceField(widget=forms.Select(attrs={'class':'form-control'}), choices=sex_choice) doctor = forms.ModelChoiceField(widget=forms.Select(attrs={'class': 'form-control'}),queryset=Patient.objects.all()) first_name = forms.CharField(widget= forms.TextInput(attrs={'class':'form-control'})) last_name = forms.CharField(widget= forms.TextInput(attrs={'class':'form-control'})) phone = forms.CharField(widget= forms.TextInput(attrs={'class':'form-control'})) birth_date = forms.DateField(widget=forms.SelectDateWidget(years=BIRTH_YEAR_CHOICES,attrs={'class': 'form-control'})) class Meta: model = Patient fields = '__all__' def __init__(self, *args, **kwargs): super(PatientForm, self).__init__(*args, **kwargs) self.fields['birth_date'].input_formats = ('%Y-%m-%d') And this register.html: <form method="POST">{% csrf_token %} <div class="input-group"> <span class="input-group-text">Prénom:</span> {{form.first_name}} </div> <div class="input-group"> <span class="input-group-text">Nom:</span> {{form.last_name}} </div> <div class="input-group"> <span class="input-group-text">Sex</span> {{form.sex}} </div> <div class="input-group"> <span class="input-group-text">Telephone</span> {{form.phone}} </div> <div class="input-group"> <span class="input-group-text">Date de naissance</span> {{form.birth_date}} </div> <div class="input-group"> <span class="input-group-text">Docteur</span> <select name="doctor_choice"> {% for doctor in doctors %} <option value="{{doctor.pk}}">{{doctor.first_name}} {{doctor.last_name}}</option> {% endfor %} </select> </div> The attrs={'class':'form-control'} is working at all the fields except the doctor field which is a ForeignKey in Patient model. So when I search about it I found that they use doctor = forms.ModelChoiceField but still dosen't work and 'class':'form-control' isn't working yet -
How can I test a function that takes record as a parameter?
I need to write a test for a function post_log_filter(record) in the file my_logging.py #my_logging.py import os import sys import traceback log_format = '[%(levelname)s] %(asctime)s %(context)s %(pathname)s:%(lineno)d: %(message)s' log_time_format = '%Y-%m-%dT%H:%M:%S%z' def post_log_filter(record): # filter out undesirable logs logs_to_omit = [ {'filename': 'basehttp.py', 'funcName': 'log_message'}, # annoying logging any response to sys.stderr (even if status is 200) {'filename': 'options.py', 'funcName': 'construct_change_message'}, # logging `Key not found` if a checkbox was unchecked and isn't present in POST data ] if any([bool(record.__dict__.viewitems() >= r.viewitems()) for r in logs_to_omit]): return False return True The test that I have written is: test_my_logging.py from my_logging import * import collections import mock from mock import patch import logging LOGGER = logging.getLogger(__name__) log_format = '[%(levelname)s] %(asctime)s %(context)s %(pathname)s:%(lineno)d: %(message)s' log_time_format = '%Y-%m-%dT%H:%M:%S%z' class TestMyLogging(TestCase): def test_post_log_filter(self): self.assertEqual(True, post_log_filter(logging.LogRecord(None, None, None, None, msg=None, args=None, exc_info=None, func=None))) def test_post_log_filter_false(self): record = logging.Formatter([ {'filename': 'basehttp.py', 'funcName': 'log_message'}, # annoying logging any response to sys.stderr (even if status is 200) {'filename': 'options.py', 'funcName': 'construct_change_message'}, # logging `Key not found` if a checkbox was unchecked and isn't present in POST data ]) self.assertEqual(False, post_log_filter(record)) I am testing it for two cases. For True: No matter what I pass for post_log_filter(), I get … -
Which field is this Django field and how to use it?
This can be found in Django Admin, under Groups table. Picture: https://imgur.com/a/Of9ZASM As I see, it is a <select> html tag with the multiple option (<select multiple>). How can we achieve it in custom tables, and how can we handle them? I looked up the django documentation, but it's not that documented (if I found the right one). -
How can I hide (not disable) in Django admin the action add model button in ModelAdmin list view?
I am aware of the following questions which are pretty different: Django Admin - Disable the 'Add' action for a specific model Disable link to edit object in django's admin (display list only)? My question is a little different: how can I disable the action button in the model list view, but retain the add functionality and links for all other Django parts (for example OneToOne relations and inlines). The code: def has_add_permission(self, request): return False disables completely the add functionality of ModelAdmin (Django 3.2+, not tested in early versions). -
Simplest way to convert python console app to web app
I'm working on text game project in Python. Currently i have finished console app + sqlite database. Now I want to convert console app to web app - it will be the first web app in my life. I want to create a simple GUI. With main logo, background image, several buttons and text zones. Example of simple GUI project: simple gui project I would like the logic of the application to be based on the code already created for console application. For example, by replacing the current console functions (for example print) with a function that returns data in the form of JSON. But without changing the internal logic of the function already written in Python. Is it possible? What is the easiest way (and what technologies?) to do that? -
Running a function asynchronously in django management command
I would like to run an API call asynchronously in a while loop inside a Django management command. My main function can't be async, I only want one subfunction to be async and the calling function not awaiting for it's completion. Just calling this async function doesn't work as it doesn't run. -
Django: When running filter with m2m values, the query takes a very long time
There are about 300,000 rows of data in the DB, and it takes a very long time to issue a query when executing a filter with m2m values. How is it possible to make it faster? Also, is it better to use raw SQL for m2m? # models.py class Tag(models.Model): name = models.CharField(unique=True, max_length=100) class Video(models.Model): title = models.CharField(max_length=300) tags = models.ManyToManyField(Tag, blank=True) # all slow query (2-3seconds) Video.objects.filter(tags__in=tags) Video.objects.filter(tags__name='tag_name') Tag.objects.annotate(count=Count("Video")) -
I want to store my primarykey values into foreignkey field
This is my models class Tasklist(models.Model): clientname= models.CharField(max_length=100,null=True,blank=True) task = models.CharField(max_length=100) startdate = models.DateField(default=timezone.now, blank=True, null=True) enddate = models.DateField(blank=True, null=True) assignee = models.CharField(max_length=30) status = models.CharField(max_length=30) fstatus = models.BooleanField(default=False) def __str__(self): return self.task + " - Task - " + str(self.fstatus) class edit_page(models.Model): old_id = models.ForeignKey(Tasklist,on_delete=models.CASCADE) updatedate = models.DateField(blank=True, null=True) time_from = models.TimeField(blank=True, null=True) time_to = models.TimeField(blank=True, null=True) messagelogs = models.TextField(blank=True, null=True) def __str__(self): return self.messagelogs This is My Views page def edit_task(request, task_id): if request.method == "POST": updatedate=request.POST.get("updatedate","") time_from=request.POST.get("time_from","") time_to=request.POST.get("time_to","") messagelogs=request.POST.get("messagelogs","") test_list=edit_page(updatedate=updatedate,time_from=time_from,time_to=time_to,messagelogs=messagelogs) test_list.save() task = Tasklist.objects.get(pk=task_id) form = TaskForm(request.POST or None, instance = task) if form.is_valid(): form.save() messages.success(request,("Task Edited ")) return redirect('email_updatetask', (task_id)) return redirect('todolist') else: task_obj = Tasklist.objects.get(pk=task_id) return render(request, 'edit.html', {'task_obj': task_obj}) can u pls how can i store my primary keys into the second foreign key field via HTML files.... -
In Django modal how can i able to store both Integer and Float? It should return both accurate without converting
In Django i have model called MachineStatus and i have a field called machine heat. Here, my machine heat will be in integer ex: 6 celcius and also it will be in 6.5 celcius. How can i do this with integer and float dynamically? class MachineStatus(models.Model): heat = models.IntegerFiled(default=0, null=True, blank=True) -
Queryset containing related Object with same foreignkey
e.g. I've a person with an address class Persons(models.Model): adress = models.ForeignKey(Adress, on_delete=models.DO_NOTHING, blank=True, null=True) class Adress(models.Model): some_data = models.IntegerField() and i have another related data in antoher model like this class Places(models.Model): adress = models.ForeignKey(Adress, on_delete=models.DO_NOTHING) how can i get a queryset now of both persons and places if adress is set in persons? -
Display: table-cell not aligning with the line numbers
I have been trying to build a html page which shows a code block with line numbers. I have used CSS table-cell display property to display the line along with line number in cell format. But the line gets displayed after the line number and I want it to be aligned in the same line. CSS Grid display works properly however with Chrome it doesn't support more than 1000 lines. Please help me resolve this issue. pre { counter-reset: line 0; display: table-cell; grid-template-columns: min-content 1fr; grid-auto-rows: 1em; gap: 0.3em; } .line-number { text-align: right; } .line-number::before { counter-increment: line; content: counter(line); white-space: pre; color: #888; padding: 0 .5em; border-right: 1px solid #ddd; } <pre> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> <span class="line-number"></span> <code>Code</code> </pre>