'''
Created on Jun 20, 2010

@author: jnaous
'''
from django import forms
from expedient.ui.html.models import SliceFlowSpace

class FlowSpaceForm(forms.ModelForm):
    """
    Form to edit flowspace.
    """
    class Meta:
        model = SliceFlowSpace
        exclude = ["slice"]

'''
Created on Jun 20, 2010

@author: jnaous
'''
from django import forms
from openflow.plugin.models import FlowSpaceRule

class FlowSpaceForm(forms.ModelForm):
    """
    Form to edit flowspace.
    """
    class Meta:
        model = FlowSpaceRule

    def __init__(self, sliver_qs, *args, **kwargs):
        super(FlowSpaceForm, self).__init__(*args, **kwargs)
        self.fields["slivers"].queryset = sliver_qs

Modify FlowSpaceForm to use actual stored rules
Modify FlowSpaceForm to use actual stored rules

  '''
  Created on Jun 20, 2010
  
  @author: jnaous
  '''
  from django import forms
- from expedient.ui.html.models import SliceFlowSpace
+ from openflow.plugin.models import FlowSpaceRule
  
  class FlowSpaceForm(forms.ModelForm):
      """
      Form to edit flowspace.
      """
      class Meta:
-         model = SliceFlowSpace
+         model = FlowSpaceRule
-         exclude = ["slice"]
+ 
+     def __init__(self, sliver_qs, *args, **kwargs):
+         super(FlowSpaceForm, self).__init__(*args, **kwargs)
+         self.fields["slivers"].queryset = sliver_qs
  
Modify FlowSpaceForm to use actual stored rules
## Code Before:
'''
Created on Jun 20, 2010

@author: jnaous
'''
from django import forms
from expedient.ui.html.models import SliceFlowSpace

class FlowSpaceForm(forms.ModelForm):
    """
    Form to edit flowspace.
    """
    class Meta:
        model = SliceFlowSpace
        exclude = ["slice"]

## Instruction:
Modify FlowSpaceForm to use actual stored rules
## Code After:
'''
Created on Jun 20, 2010

@author: jnaous
'''
from django import forms
from openflow.plugin.models import FlowSpaceRule

class FlowSpaceForm(forms.ModelForm):
    """
    Form to edit flowspace.
    """
    class Meta:
        model = FlowSpaceRule

    def __init__(self, sliver_qs, *args, **kwargs):
        super(FlowSpaceForm, self).__init__(*args, **kwargs)
        self.fields["slivers"].queryset = sliver_qs
