Skip to content

Core Models


Gender Model

The Gender model represents the gender of a user.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the gender.
gender_type CharField Yes Type of gender (e.g., "Male", "Female").

Custom Methods

  • get_gender_type()
  • Returns the gender type.

Country Model

The Country model represents a country where a user resides.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the country.
country_name CharField Yes Name of the country.
iso_code CharField Yes ISO code of the country.

Custom Methods

  • get_country_name()
  • Returns the name of the country.

State Model

The State model represents a state or province within a country.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the state.
name CharField Yes Name of the state or province.
country ForeignKey Yes Reference to the associated Country model.

Custom Methods

  • get_state_name()
  • Returns the name of the state.

Custom Methods

  • get_vendor_type()
  • Returns the type of the vendor.

NewsletterType Model

The NewsletterType model represents the types of newsletters a user can subscribe to.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the newsletter type.
newsletter_type CharField Yes Type of newsletter (e.g., "Daily", "Weekly").

Custom Methods

  • get_newsletter_type()
  • Returns the type of newsletter.

CustomConfig Model

The CustomConfig model stores custom configuration data.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the configuration.
key CharField Yes Configuration key.
value CharField Yes Configuration value.
created_at DateTimeField No Timestamp when the configuration was created.
updated_at DateTimeField No Timestamp when the configuration was last updated.

Custom Methods

  • get_config_value()
  • Returns the configuration value for a given key.

PaymentMethod Model

The PaymentMethod model stores available payment methods.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the payment method.
method_name CharField Yes Name of the payment method.

PayPalSettings Model

The PayPalSettings model stores PayPal settings.


Field Name Type Description Required
client_id CharField The PayPal client ID for authentication. Yes
secret_key CharField The PayPal secret key for authentication. Yes
api_base_url CharField The base URL for the PayPal API (sandbox or live). Yes
mode CharField Defines whether the environment is sandbox or live. Yes

Custom Methods

  • __str__()
  • Returns the client_id and api_base_url as a string representation.

OrderStatus Model

The OrderStatus model stores various statuses for orders.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the order status.
status_name CharField Yes Name of the order status.

Custom Methods

  • __str__()
  • Returns the order status name as a string representation.

ProductStatus Model

The ProductStatus model stores various statuses for products.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the product status.
status_name CharField Yes Name of the product status.

Custom Methods

  • __str__()
  • Returns the product status name as a string representation.

MeasurementField Model

The MeasurementField model stores measurement attributes for products.


Fields

Field Type Required Description
id IntegerField Yes Unique identifier for the measurement field.
name CharField Yes Name of the measurement field.
is_active BooleanField No Indicates if the field is active (default: True).
created_at DateTimeField No Timestamp when the measurement field was created.

Custom Methods

  • __str__()
  • Returns the name of the measurement field as a string representation.

SocialLoginSettings Model

The SocialLoginSettings model stores the redirect uri for facebook and google signup.

Fields

Field Type Required Description
name CharField Yes name of social login eg. Facebook, Google
redirect_uri URLField Yes redirect uri