Giter Site home page Giter Site logo

Comments (3)

asifpy avatar asifpy commented on June 15, 2024

Can you please send me your ModelCrud class.

from django-crudbuilder.

marcoshemann avatar marcoshemann commented on June 15, 2024

of corse, i try in more that one models.

class Plano(models.Model):
nome = models.CharField("Nome do Plano", max_length=50)
valor_mensal = models.DecimalField("Valor Mensal", max_digits=8, decimal_places=2, default=0)
valor_ativacao = models.DecimalField("Valor da Ativação", max_digits=8, decimal_places=2,default=0 )
valor_coletor = models.DecimalField("Valor do Coletor", max_digits=8, decimal_places=2, default=0)
sit = models.IntegerField("Situação", choices=GLOBAL_STATUS, default = 1)
sit_web = models.IntegerField(choices=GLOBAL_STATUS, default = 1)
nr_coletores = models.IntegerField("Número de Coletores", default=1)
nr_hosts = models.IntegerField("Número de Host's", default=100)
promocode = models.CharField("Código Promocional", max_length=50, blank=True, null=True,)
valido_ate = models.DateTimeField("Vencimento", default=timezone.now)
frequencia = models.IntegerField("Frequencia Cobrança", default=1)

class Meta:
    ordering = ['nome']
    verbose_name = 'plano'
    verbose_name_plural = 'planos'

def __str__(self):
    return self.nome

class PlanoCrud(BaseCrudBuilder):
model = Plano
search_feilds = ['nome']
tables2_fields = ('nome', 'valor_mensal', 'sit')

tables2_css_class = "table table-bordered table-condensed"

tables2_css_class = "table table-bordered table-striped dataTable"
tables2_pagination = 4  # default is 10

modelform_excludes = ['created_by', 'updated_by']

login_required=True
permission_required=False
custom_modelform = PlanoForm
custom_templates = {
    'list': 'cadastro/crud/crud_list.html',
   # 'create': 'cadastro/crud/crud_create.html',
    'create': 'cadastro/cadC.html',
    'detail': 'cadastro/crud/crud_detail.html',
    'update': 'cadastro/cadC.html',
    'delete': 'cadastro/crud/crud_delete.html'
    }

from django-crudbuilder.

asifpy avatar asifpy commented on June 15, 2024

Pagination bug has been resolved here : 40c0b8d

from django-crudbuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.