from django.db import models
from audit_trail.audit import AuditTrail
from my_base_model.classes import BaseUuidModel
from my_class_base import BaseClass
class Mini(BaseMaternalVisitModel):
my_class_base = models.ForeignKey(BaseClass)
class MiniHu(BaseUuidModel):
myclass = models.ForeignKey(Mini)
class Meta:
app_label="classes"
Run Code Online (Sandbox Code Playgroud)
当我跑步时,python manage.py validate我得到这个错误
<MiniHu> has a relation with model <Mini>, which has either not been installed or is abstract.
Run Code Online (Sandbox Code Playgroud) 我想画一个可以在 Jpanel 上移动的画布。那就是当用户点击画布并拖动它时,它必须移动到一个新的位置。我已经实现了 MouseMotionListener 但我不知道在里面包含什么来使画布按照要求移动。这是 DisplayCanvas 类:
class DisplayCanvas extends Canvas
{
public DisplayCanvas()
{
setBounds(20, 40, 300, 300);
setBackground(Color.white);
}
}
class shape extends JFrame implements MouseMotionListener{
static JPanel panel;
static Container contentpane;
static DisplayCanvas canvas;
shape()
{
canvas=new DisplayCanvas();
canvas.addMouseMotionListener(this);
panel= new JPanel();
panel.setBounds(20,20,250,140);
panel.setLayout(null);
contentpane = getContentPane();
contentpane.add(canvas);
contentpane.add(panel);
}
@Override
public void mouseDragged(MouseEvent e) {}
@Override
public void mouseMoved(MouseEvent arg0) {}
}
Run Code Online (Sandbox Code Playgroud)
这就是我测试它的方式。
public class display
{
static JFrame frame;
public static void main(String[] args)
{ …Run Code Online (Sandbox Code Playgroud)