Code Monkey home page Code Monkey logo

crud's People

Contributors

harikvpy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

crud's Issues

NoReverseMatch at /incident/os/ Reverse for '/incident/inventory'

Hi Hari,

I encounter error below when use the related field, inventory itself can display with url /incident/inventory/ but no inline formset shown for OS, pls advise

class inventoryCRUDView(CRUDView):
model = inventory
list_display = ('appcode', 'appcode_desc', 'hostname', 'alias', 'env')
def get_formset_class(self):
return inlineformset_factory(
inventory,
OS,
fields=['OS_name', 'OS_current_version','OS_patch_level'],
can_delete=True,
extra=1)

class OSCRUDView(CRUDView):
model = OS
list_display = ('OS_name', 'OS_current_version','OS_patch_level')
related_field_crud_urls = {
'inventory': reverse_lazy("incident:inventory")
}
allow_multiple_item_delete = True

def get_actions(self):
    self.related_field_crud_urls = {
        'inventory': reverse_lazy('incident:inventory') +"?o=add",
        }
    return [
        ('Delete', self.delete_multiple_items)
        ]

def delete_multiple_items(self, request, items):
    OS.objects.filter(pk__in=items).delete()

NoReverseMatch at /incident/os/
Reverse for '/incident/inventory' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method: GET
Request URL: http://localhost:8999/incident/os/
Django Version: 1.8.6
Exception Type: NoReverseMatch
Exception Value:
Reverse for '/incident/inventory' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

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.