model Questions

7

I want to create a select list for lets say colors, but dont want to create a table for the colors. I have seen it anywhere, but can't find it on google. My question is: How can I put the colors ...
Kreager asked 17/1, 2013 at 22:14

5

Solved

I have a ViewModel that has a complex object as one of its members. The complex object has 4 properties (all strings). I'm trying to create a re-usable partial view where I can pass in the complex ...
Rayon asked 22/4, 2015 at 20:52

6

Solved

if request.method == 'POST': userf = UsersModelForm(request.POST) username = userf.data['username'] password = userf.data['password'] passwordrepeat = userf.data['passwordrepeat'] email = user...
Overbearing asked 19/1, 2012 at 11:6

8

Solved

I have the following 2 models class Sport < ActiveRecord::Base has_many :charts, order: "sortWeight ASC" has_one :product, :as => :productable accepts_nested_attributes_for :product, :all...
Abrasion asked 7/3, 2012 at 22:42

3

Solved

I'm new at deep learning and i follow tutorial about face detection. model = canaro.models.createSimpsonsModel(IMG_SIZE=IMG_SIZE, channels=channels, output_dim=len(characters), loss='binary_cross...
Morion asked 8/12, 2022 at 18:15

5

Solved

Now I'm using django 1.6 I have two models relates with a OneToOneField. class A(models.Model): pass class B(models.Model): ref_a = models.OneToOneField(related_name='ref_b', null=True) Fi...
Esbjerg asked 20/9, 2014 at 3:44

7

Solved

I am using Keras with TensorFlow backend to train CNN models. What is the between model.fit() and model.evaluate()? Which one should I ideally use? (I am using model.fit() as of now). I know th...
Urga asked 30/6, 2017 at 9:51

10

Solved

I'm moving some of my find code inside models. Previously in my controller I had $this->Book->Review->find('first', array( 'conditions' => array( 'Review.book_id' => $id, 'Revie...
Tyson asked 27/1, 2010 at 20:24

3

Solved

I am trying to write a model but i keep getting this error. Here is the code. import 'package:flutter/material.dart'; class CardModel { late List<CardResults> results; CardModel({ required ...
Garrettgarrick asked 7/6, 2023 at 23:38

6

Solved

(I come from Visual Studio + Entity Framework background and trying to locate equivalent functionality in Laravel + Eloquent) In EF and Visual Studio, we add a new Model to our application and just...
Mairamaire asked 8/8, 2018 at 11:30

6

Solved

I'm trying to remove the commas from a field in a model. I want the user to type a number, i.e. 10,000 and that number should be stored in the database as 10000. I was hoping that I could do some m...
Repossess asked 19/5, 2009 at 16:44

16

Solved

I would like my User model to sanitize some input before before save. For now some simple whitespace stripping will do. So to avoid people registering with "Harry " and pretend to be "Harry", for ...
Tarantella asked 16/7, 2010 at 19:5

4

Solved

How can I get a model name as a "string" from a model instance. I know you can do something like type(model_instance) but this is returning the class itself as an object <Model_Name: > not a...
Burning asked 14/3, 2018 at 0:54

11

Solved

I followed a few guides on creating a custom tag helper for ASP Core. This is my helper: using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; using System; n...
Permeability asked 15/1, 2018 at 22:23

3

Solved

I have a method in model that calls after create after_create :generate_insurer_recovery_invoice, if: :insurance_recovery_batch? How should I write another condition within this callback?
Cheese asked 10/3, 2016 at 7:20

6

Solved

I need to query a SQLAlchemy database by its id something similar to User.query.filter_by(username='peter') but for id. How do I do this? [Searching over Google and SO didn't help]
Tetanize asked 19/7, 2011 at 15:43

4

Solved

I have a signal callback in django: @receiver(post_save, sender=MediumCategory) def update_category_descendants(sender, **kwargs): def children_for(category): return MediumCategory.objects.filt...
Pyxidium asked 14/7, 2012 at 20:23

9

Solved

I have in my DataBase a table with two primary keys (id and language_id) and I need put it in my models. The default primaryKey in Models (Model.php in Laravel 5) is id, and I want that the primary...
Nonreturnable asked 14/7, 2015 at 19:5

4

Solved

I use the following bit of code in my Django app: pictures = gallery.picture_set.annotate( score=models.Sum( 'picturevote__value' ) ).order_by( '-score' ) There is a table of galleries. In each ...
Daugavpils asked 16/2, 2009 at 11:38

4

Solved

I am trying to learn domain-driven design (DDD), and I think I got the basic idea. But there is something confusing me. In DDD, are the persistence model and domain model different things? I mean,...

2

Solved

7 project and i have this global scope for Voucher_detale model <?php namespace App\Scopes; use Illuminate\Database\Eloquent\Scope; use Illuminate\Database\Eloquent\Model; use Illuminate\Datab...
Schoolmistress asked 25/10, 2018 at 10:17

6

Solved

I'm new to django and I'm facing some difficulties in creating a user from the AbstractBaseUser model. Now I'm starting wondering if my user model is not being build in the right way. This is my Us...
Aldosterone asked 18/9, 2016 at 15:56

5

Solved

I've got a table for a sports team. The record shows the team selection and some other information. I want to update the record with the team selection. My model is thus: class Selection extends M...
Hove asked 8/2, 2016 at 21:43

2

Yeah, so, I want to store translated choices for my model, but Django disagrees with me on this one. Version of Django is 1.3 and the model and choices look something like this: from django.db imp...
Poche asked 22/2, 2013 at 14:52

3

Solved

models.py=> from django.db import models from django.forms import ModelForm from datetime import date import datetime from django import forms from django.forms import Textarea class Post(models....
Athletic asked 6/1, 2012 at 16:32

© 2022 - 2024 — McMap. All rights reserved.