Questions tagged [models]

A model is an abstract representation of a real-life object or process. Models are a part of the popular MVC pattern, as well as a more general concept in the sciences for approximating behavior.

A model is one of the three components of Model-View-Controller (MVC) programming pattern that provides knowledge: data and how to work with this data, responding to requests by changing its state.

It can also refer to models in a more general scientific sense, denoting a representation (generally a simplification) of how a real-world process operates.

2397 questions
0
votes
0 answers

Error update formatted sequence number table

i have code like this: class NumberSequence(models.Model): code = models.CharField(max_length=12) prefix = models.CharField(max_length=3, verbose_name='Prefix') length = models.IntegerField(verbose_name='Digit Length') last =…
Pams
  • 25
  • 3
0
votes
1 answer

Django Update Multiple Object error

i found some problem when i try to update multiple object in my models. here is my models: class NumberSequence(models.Model): code = models.CharField(max_length=12) name = models.CharField(max_length=60) prefix =…
Pams
  • 25
  • 3
0
votes
1 answer

How do you handle the deletion of your model working with ViewModels and keeping them in sync?

These could be my entity relations: 1 Pupil has 1 Chair 1 Pupil has N Documents 1 Pupil has N Marks 1 Pupil has N IncidentReports etc... So with that sample I get 4 IEnumerable from my database put each into an ObservableCollection. Now I have 4…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
0
votes
1 answer

Filtering Queryset and designing correct urls.py and templates in Django

I am designing a video rendering kids website. The app has parent categories for eg: Cartoons, Education shows etc. Each category has multiple posts such as Jungle_book,Duck_tales etc for cartoons. Each post has multiple episodes. I am using…
0
votes
2 answers

How to filter a unique user's info to show on its own url

Edit: Here are my Views and My models and the Html.I am trying to make a user profile page in django. I need to query and and pull only the Info of the request.user in the profile page.The problem seems to be that I am not able to get the correct…
Migdotcom
  • 72
  • 1
  • 11
0
votes
0 answers

Umbraco get dictionary item value in Models Builder Partial Class

I am using Umbraco 7.6 And And using Model builder (EnableAPI) As I have extended on the Models mean to say have created a partial class to perform some manipulations. So now my query is that can we get the value of dictionary Item in this partial…
BJ Patel
  • 6,148
  • 11
  • 47
  • 81
0
votes
1 answer

Using Rails 5 + Devise, I can't get the models to associate with each other

Originally I had a Joke.rb model that belonged to User model. Joke table had :joke, :author. It worked perfectly when using @joke = current_user.jokes.new(joke_params) but I took the :author out of the Joke model and made it its own model so I can…
user4536120
0
votes
1 answer

many-one field or foreign key Django if wish to have several submission with the same ID but different details

My timesheet.html will have the variables of ID, name, startDate and endDate. I wish to display all these fields in a table in list_timesheet.html. But i have a problem of displaying the same ID and same name several times with different start and…
user5466566
0
votes
2 answers

model (3ds) stats & snapshot in linux

I want to write an app that takes in a model filename via cmd line, create a list of stats (poly count, scaling, as much as possible or maybe the stats that i would like) and to load the model with its textures (with anything else) and draw it from…
user34537
0
votes
1 answer

How to delete an entry object object

I can create a form with Django that has a mysql background. I wonder if it is possible to create a code that allows you to delete an object. So supposing I had a client called "Tony", and I wanted to create some python code that allowed me to…
Shehzad009
  • 1,547
  • 6
  • 28
  • 42
0
votes
0 answers

Constructing interactive object structures for use in canvas

How do I go from drawing detached pixels on the canvas to rendering interactive entities? My best guess is by adding event listeners to the constructors of self drawing objects, which cleverly add and remove further event listeners as necessary to…
Musixauce3000
  • 549
  • 1
  • 3
  • 11
0
votes
1 answer

ValueError: too many values to unpack in Django models

Test.py The files serves to test everything within the memepost app. from django.test import TestCase from memepost.models import memepost, memepostForm from datetime import date import logging logging.basicConfig(level=logging.INFO) logger =…
Rahmi Pruitt
  • 569
  • 1
  • 8
  • 28
0
votes
1 answer

Django OneToMany Field with predefined Models

I'd like to make a OneToMany-relationship between one of my models and the builtin Permission model of django.contrib.auth.models. My plan is to create at least one new permission when my model is created and delete this/these permissions when the…
0
votes
1 answer

How to write complex query for three tables?

Please help me. I am having three tables as, Users:id,name.... Message:id,title.... Messages_Users:id,message_id,sender_id,receiver_id...... So i am using HABTM relation in message model for this as, var $hasAndBelongsToMany = array( 'Users'…
vk1985
  • 11
  • 1
  • 3
0
votes
1 answer

Set a model field to a search result

I have a model of Teacher that creates classes. I have another model of students who take the classes but do not create them. I also have the classes model. What I a trying to do is have the student search for classes and click on a result and add…
thatguy
  • 97
  • 9
1 2 3
99
100