小编Par*_*ian的帖子

无法在Bootstrap中提交我的模式表格

Django初学者在这里需要帮助!我正在尝试以模态形式上传图像,问题是我无法提交模态...当我单击提交按钮时,实际上什么都没有发生...在2天的苦苦挣扎中...我正在使用Bootstrap V 1.0.4从网络上尝试了一些JS代码,但没有一个对我有用...我知道该怎么办?谢谢...这是我的模态:

 <div id="myModal" class="modal fade" role="dialog">
                      <div class="modal-dialog">

                         <!-- Modal content-->
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">????? ???</h4>
                          </div>
                         <div class="modal-body">
                          <p>????? ????? ???? ??? ?? ????? ??? ?? ????? ??? ???? ??????:</p>
                             <ul>
                                 <li>?????? ??? ???? ???? ???? ???? ?????? 8 ??????? ?? ????</li>
                                 <li>???? ??? ?????? ????: jpg , Gif , PNG</li>
                                 <li>?? ???? ????? ??? ??? ????????? ??? ? ??? ??? ?? ??? ??? ????? ?????? ?? ? ?? ?? ??? …
Run Code Online (Sandbox Code Playgroud)

python django jquery twitter-bootstrap

3
推荐指数
1
解决办法
2062
查看次数

Django models.py中的NameError

我有5个班,Customer,Supplier,Order,DesignOutSource.它Order有3个关系,一对一Customer,多对多Design,一对一OutSourse.首先,我只是没有将其添加s one to one relationship with客户(customer=models.ForeignKey(Customer)), now I wanna add the those 2 relationships with设计andOutsourse`.

 design=models.ManyToManyField(Design)
 outSource=models.OneToOneField(OutSource)
Run Code Online (Sandbox Code Playgroud)

当我这样做并运行"makemigrations"命令时,我收到此错误 - >"NameError:name"设计"未定义"没有那两行代码我可以迁移而没有任何问题...无法弄清楚哪里出错了 任何帮助将不胜感激.

models.py

class Order(models.Model):
    o_type=models.CharField(max_length=15, verbose_name='Order type')
    number=models.IntegerField()
    date=models.DateField()
    status=models.CharField(max_length=25)
    delivery_date=models.DateField()
    customer=models.ForeignKey(Customer)
    design=models.ManyToManyField(Design)
    outSource=models.OneToOneField(OutSource)

class Design(models.Model):
    dimension=models.IntegerField()
    image=models.ImageField(upload_to='images/%Y/%m/%d')
    number_of_colors=models.IntegerField()
    sides=models.IntegerField(verbose_name='side(s)')

class OutSource(models.Model):
    date=models.DateField()
    number=models.IntegerField()
    description=models.CharField(max_length=100)
    code=models.IntegerField()
    supplier=models.ForeignKey(Supplier)
Run Code Online (Sandbox Code Playgroud)

python django django-models

1
推荐指数
1
解决办法
561
查看次数